-
Notifications
You must be signed in to change notification settings - Fork 526
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-12608. Race condition in datanode version file creation #8093
base: master
Are you sure you want to change the base?
Conversation
@adoroszlai , as mentioned in HDDS-12608, this seems a bug in the datanode code (or in the test) -- it should never have more than one threads writing to the VERSION file at the same time. So, we should fix them instead. |
There is no test involved, it can be reproduced by simply starting a new datanode in HA cluster.
I think there are two issues:
This PR is limited to (1), we can fix (2) separately. |
The race condition is good thing since it has caught the bug. If we write to different tmp files, then the bug will happen silently. We don't have a legitimate case to allow multiple threads writing to the same file at the same time. |
What changes were proposed in this pull request?
Multiple threads may create the VERSION file. After HDDS-12456 they use the same temporary file for
AtomicFileOutputStream
.https://issues.apache.org/jira/browse/HDDS-12608
How was this patch tested?
CI:
https://github.com/adoroszlai/ozone/actions/runs/13874311835