Repository navigation
Conversation
1eb701f to
b92cc92
Compare
|
Claude Code (an AI assistant), posting on behalf of Andrew Purtell. The 5.4 stabilization sweep found that this issue is still present on master (
I rebased the PR onto the latest master, fixed a spotless failure in @virajjasani, could you please review? |
There was a problem hiding this comment.
🟡 Changes recommended
A deterministic regression test is missing to verify that a retained client and transaction context use the replacement manager for lookup and begin/commit/abort operations.
What changed in this PR
This PR prevents stale Omid transaction-manager references when tests replace the provider’s manager between test classes, while preserving behavior when the production manager remains unchanged.
Changes:
- Makes the provider’s manager volatile and resolves it dynamically through the client wrapper.
- Updates transaction contexts to retrieve the current manager for each operation rather than caching it.
- Adds null-manager handling during transaction reconstruction and DDL fencing.
| File | Description |
|---|---|
| phoenix-core-client/src/main/java/org/apache/phoenix/transaction/OmidTransactionProvider.java | Publishes manager replacements and makes the client a live view of the provider. |
| phoenix-core-client/src/main/java/org/apache/phoenix/transaction/OmidTransactionContext.java | Replaces the cached manager with per-operation lookups and adds null handling. |
Review effort: Balanced
…view OmidTransactionContext now gets the current transaction manager from the provider on each call. A replaced manager then does not leave a stale reference in a cached context or client. The test connection services now share one test transaction service for each provider in the JVM. A server-side connection service no longer starts a second TSO and replaces the manager and commit table of the singleton provider while a transaction is open. Open regions keep the commit table they had when they opened, so such a swap let readers miss committed rows. The connection service that starts the shared service owns it and closes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b92cc92 to
9200e5a
Compare
|
Posted by Claude Code (an AI assistant) on behalf of Andrew Purtell. Follow-up from the 5.4 stabilization sweep. With this PR applied, a docker gate run (HBase 2.5, JDK 11) hit a new flake: Cause, in test code only: a server-side connection, here from a compaction, gets its own Fix, now folded into the PR commit ( Evidence (docker, JDK 11):
The branch is rebased onto the latest master ( @virajjasani, could you please review? |
The change edits three lines that carry existing checkstyle warnings, so precommit counts them as new. Remove the parentheses around an assert expression, add braces to a one-line if, and drop a redundant public modifier on a constructor of a package-private class. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…manager A new unit test makes an Omid client and a transaction context while one transaction manager is installed, then installs a second manager. The test checks that the kept client returns the second manager and that begin, commit and abort on the kept context reach only the second manager. The test restores the provider state when it ends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
When connection service B reuses the shared transaction service started by A, closing A shuts down the transaction manager and TSO even though B remains open. B’s retained contexts continue to use the closed manager without reinitializing it, so B’s next transaction fails.
1 open issue
1 resolved since last review
Review effort: Balanced
… user The test connection services in a JVM share one transaction service per provider. The service that started it used to close it, even while other connection services still used it. Now each shared service counts its users, and the last user to release it closes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>


OmidTransactionClientcaptures the provider'sHBaseTransactionManagerat construction time.OmidTransactionContextin turn caches that same reference in a private field. When a prior test class shuts down OMID's TSO together with its mini-cluster, the next test class reuses the stale wrapper and is dispatched to the dead executor. The symptom is aRejectedExecutionExceptionoriginating from the OMID TSOClient state-machine executor.In production the singleton's manager is set exactly once and never replaced, but the test framework exercises the swap path between classes within a single Surefire/Failsafe fork.
Fix:
OmidTransactionClientbecomes a thin view onto the singleton's currentHBaseTransactionManager. It resolvesprovider.transactionManageron every call togetTransactionClient().transactionManageris marked volatile so test-framework injection is published to other threads without synchronization.In production the dynamic lookup is functionally identical to caching.