-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IGNITE-21371 Add tx coordinator id to TX requests #3128
Conversation
...a/org/apache/ignite/internal/table/distributed/replication/request/CommittableTxRequest.java
Outdated
Show resolved
Hide resolved
...le/src/main/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImpl.java
Outdated
Show resolved
Hide resolved
...le/src/main/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImpl.java
Outdated
Show resolved
Hide resolved
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/TxMessageSender.java
Outdated
Show resolved
Hide resolved
* | ||
* @return the transaction coordinator inconsistent ID | ||
*/ | ||
String txCoordinatorId(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need txCoordinatorId in TxFinishReplicaRequest? Use-cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See PartitionListener.handleFinishTxCommand
, line 351:
markFinished(txId, cmd.commit(), cmd.commitTimestamp(), cmd.txCoordinatorId());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean logically. Why do we need coordinatorId on finish request? From my point of view, we use coordinatorId retrieved from txnState local map in two cases only.
- In order to check whether coordinator is dead and trigger the recovey, which definitely has no sense in case of finished transaction.
- In order to decrement counter of an "in-flight" transactions that is used within index build procedure. In that case it's guaranteed that txnState local map will be populated with txCoordId prior to finish processing.
All in all, I believe that we may remove txCoordinatorId() from TxFinishReplicaRequest and update
private void markFinished(UUID txId, boolean commit, @Nullable HybridTimestamp commitTimestamp) {
txManager.updateTxMeta(txId, old -> new TxStateMeta(
commit ? COMMITTED : ABORTED,
old == null ? null : old.txCoordinatorId(),
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same applies to WriteIntentSwitch command handling
.../transactions/src/main/java/org/apache/ignite/internal/tx/impl/ReadWriteTransactionImpl.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
https://issues.apache.org/jira/browse/IGNITE-21371