-
Notifications
You must be signed in to change notification settings - Fork 509
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-11137. Removed locks from SnapshotPurge and SnapshotSetProperty APIs. #7018
Conversation
e85485d
to
343a702
Compare
But it wouldn't hurt to have the locking right? Since future changes could still impact this right? Any particular reason why we are removing the locks? |
Yes, it is not causing any issues. But these locks are unnecessary right now and are just increasing the complexity. As mentioned in the description, these locks were added mainly because SSTFilteringService was updating SnapshotInfoTable directly, HDDS-10590. But, in HDDS-11068, we figured that even after adding the locks, it didn't solve the problem and the snapshot chain corruption issue persisted if OM crashed and the double buffer was not flushed.
As long as any update to SnapshotInfoTable goes through Ratis, we don't need these locks. |
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 for the patch @hemantk-12 The patch looks good to me. Do you think we can add some sort of test case here for this change?
Can't think of anything on top of my head but I can create a follow up task for it? |
…APIs. (apache#7018) (cherry picked from commit ad7b8db)
What changes were proposed in this pull request?
In HDDS-10590, we introduce the locks to achieve synchronization among snapshot purge, set snapshot property, and SSTFilteringService because SSTFilteringService was directly updating the snapshotInfo table and might be causing the snapshot chain corruption.
In HDDS-11068, we found that the snapshot chain corruption issue still exists even after the locks. And the actual reason is that SSTFilteringService directly updates the DB and persists it. More details in HDDS-11068.
In a fix #6965 for HDDS-11068, we removed the logic to persist
sstFiltered
flag insnapshotInfoTable
. Now we create a touch file in snapshot dir which is local to OM node.Since all the other operations updating
snapshotInfoTable
go through Ratis, we can rely on OM state machine for the synchronization and remove the unnecessary locking.What is the link to the Apache JIRA
HDDS-11137
How was this patch tested?
Existing tests.