Fix concurrent access during TierManager folder reset#18223
Conversation
| List<FolderManager> newSeqTiers = new ArrayList<>(); | ||
| List<FolderManager> newUnSeqTiers = new ArrayList<>(); | ||
| List<FolderManager> newObjectTiers = new ArrayList<>(); | ||
| seqDir2TierLevel.clear(); |
There was a problem hiding this comment.
[P1] Build and publish the directory maps with the tier lists seqDir2TierLevel and unSeqDir2TierLevel are still cleared and repopulated in place while their readers are unsynchronized. During loadHotModifiedProps(), readers such as getAllFilesFolders() can observe an empty or partial map, while getFileTierLevel() can race with HashMap mutation and throw ConcurrentModificationException. Please build replacement maps locally and publish them together with the folder-manager lists, and cover these accessors in the regression test.
There was a problem hiding this comment.
Included these maps in initFolders.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #18223 +/- ##
============================================
+ Coverage 42.40% 42.75% +0.34%
Complexity 343 343
============================================
Files 5354 5356 +2
Lines 379174 380160 +986
Branches 49149 49317 +168
============================================
+ Hits 160803 162536 +1733
+ Misses 218371 217624 -747 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|


Description
Tests
mvn test -pl iotdb-core/datanode -Dtest=TierManagerTestmvn test -pl iotdb-core/datanode -Dtest=IoTDBSnapshotTestmvn compile -pl iotdb-core/datanode -DskipTests