-
Notifications
You must be signed in to change notification settings - Fork 9k
HDFS-16953. RBF: Mount table store APIs should update cache only if state store record is successfully updated #5482
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 s 8000 end you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ate store record is successfully updated
@goiri @ayushtkn @Hexiaoqiao could you please review this PR? |
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.
Reading the description, got a bit confused around the failed mount entry add fail stuff.
So, Just to clarify,
In layman terms:
-
There were concurrent addMountEntry for same mount path from different Routers.
-
One Router succeeded and the other failed because entry got in already?
-
It failed as expected and normally, no bug here? As far as I understood the answer is Yes.
-
The only problem is since the add entry failed there was no need to update the cache as nothing changed and that what the code does and the description says?
If I got it all right, then changes LGTM
Absolutely sir, all points are correct. Sorry for adding more details above. I wish I had a way to write a test to validate this, I tried but could not find better way to write a test. I found that we have some tests like TestRouterAdminCLI#testAddMountTable for which one of the addMountEntry calls fails (log |
While exactly verifying this patch's behavior might not be feasible (non-flaky test), let me at least validate that source and destination both are present with one successful and one failed attempt of adding the mount table entry. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
…tate store record is successfully updated (apache#5482)
RBF Mount table state store APIs addMountTableEntry, updateMountTableEntry and removeMountTableEntry performs cache refresh for all routers regardless of the actual record update result. If the record fails to get updated on zookeeper/file based store impl, reloading the cache for all routers would be unnecessary.
For instance, simultaneously adding new mount point could lead to failure for the second call if first call has not added new entry by the time second call retrieves mount table entry from getMountTableEntries before attempting to call addMountTableEntry.
The failure to write new record:
Since the successful call has already refreshed cache for all routers, second call that failed should not have refreshed cache for all routers again as everyone already has updated records in cache.