-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-8978. SCM SequenceIdGenerator#reinitialize only needs to acquire the lock once #5027
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
HDDS-8978. SCM SequenceIdGenerator#reinitialize only needs to acquire the lock once #5027
Conversation
|
Could I ask what are the cases where deadlocks happen, and is this PR #5018 related? |
|
The linked Jira is [HDDS-8965], @guohao-rosicky you might need to correct it |
adoroszlai
left a comment
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.
Thanks @guohao-rosicky for working on this.
- Can you please provide more details about the deadlock? It would be great if you could attach a thread dump to the Jira issue.
- Without knowing the details, I don't think the patch fixes any deadlocks.
lockis aReentrantLock. If it islock()-ed twice, it needs to beunlock()-ed twice before it is released. Thuslockis held until return fromreinitialize, whether it callsinvalidateBatchorinvalidateBatchInternal.
|
Thanks @adoroszlai for the comment, as you said, I was wrong in my description, this modification reduces the locks by one since reinitialize only needs to acquire the locks once |
adoroszlai
left a comment
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.
Thanks @guohao-rosicky for clarifying the intent of this change.
| throws IOException { | ||
| lock.lock(); | ||
| try { | ||
| LOG.info("reinitialize SequenceIdGenerator."); |
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 think we should move the log statement out of the lock.
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.
sure.
|
Thanks @guohao-rosicky for the patch, @xichen01, @Xushaohong for the review. |
What changes were proposed in this pull request?
SCM SequenceIdGenerator#reinitialize only needs to acquire the lock once
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-8978