vaijosh opened a new pull request, #3164:
URL: https://github.com/apache/hugegraph/pull/3164
## Purpose of the PR
- close #3162
This PR addresses a race condition that occurs during snapshot saves when
compaction is busy, which could previously lead to corrupted snapshots or stuck
partitions.
## Main Changes
- **Throw on compaction-busy:** Modified the snapshot save behavior to throw
an exception rather than returning early/silently failing when compaction is
busy.
- **Validate `data/` on load:** Added validation during the snapshot load
process to verify the presence of the `data/` directory, preventing the system
from loading incomplete snapshots.
- **Reproduction Script:** Added `test-snapshot-corruption.sh` to
deterministically reproduce the bug and validate the fix across different
storage states.
- **Unit Tests:** Added UTs to cover the new validation logic and race
condition handling.
## Verifying these changes
- [ ] Trivial rework / code cleanup without any test coverage. (No Need)
- [ ] Already covered by existing tests, such as *(please modify tests
here)*.
- [x] Need tests and can be verified as follows:
- Execute the newly added unit tests.
- Run the `test-snapshot-corruption.sh` script to verify the corrupted
snapshot detection and prevention.
## Does this PR potentially affect the following parts?
- [ ] Dependencies
- [ ] Modify configurations
- [ ] The public API
- [ ] Other affects (typed here)
- [x] Nope
## Documentation Status
- [ ] `Doc - TODO`
- [ ] `Doc - Done`
- [x] `Doc - No Need`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]