Skip to content
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

[Transaction] Fix transaction log append sync problem. #9238

Conversation

congbobo184
Copy link
Contributor

Motivation

When the transaction status become aborted or committed the cursor may not delete the position, if not lock transaction operation and add append log position.

If the txnMetaImpl have recycle, the same time we update the txnStatus in this recycle one we will produce the error behavior.

implement

Verifying this change

Does this pull request potentially affect one of the following parts:
If yes was chosen, please highlight the changes

Dependencies (does it add or upgrade a dependency): (no)
The public API: (no)
The schema: (no)
The default values of configurations: (no)
The wire protocol: (no)
The rest endpoints: (no)
The admin cli options: (no)
Anything that affects deployment: (no)

@hangc0276
Copy link
Contributor

/pulsarbot run-failure-checks

@codelipenghui
Copy link
Contributor

@congbobo184 Could you please give more details about this issue? If it is the recycling issue, I don't think a lock can fix it, the recycle operation still can get the lock first. If this is a race condition while update the state of the TxnMetaImpl, I noticed TxnMetaImpl is a thread-safe implementation.

@congbobo184
Copy link
Contributor Author

/pulsarbot run-failure-checks

@codelipenghui codelipenghui merged commit e88da2a into apache:master Mar 2, 2021
mlyahmed pushed a commit to mlyahmed/pulsar that referenced this pull request Mar 5, 2021
## Motivation
When the transaction status become aborted or committed the cursor may not delete the position, if not lock transaction operation and add append log position. 

If the txnMetaImpl have recycle, the same time we update the txnStatus in this recycle one we will produce the error behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants