Fix multi-recovery metadata indexing and add regression coverage.#783
Merged
jt2594838 merged 1 commit intoapache:developfrom Apr 16, 2026
Merged
Conversation
Use value-based device keys in TSMIterator and merge recovered chunk metadata by device/measurement so repeated recovery writes do not trigger duplicate-device index failures; add a multi-round recovery test and relax a filesystem error assertion for environment consistency.
jt2594838
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
中文
TSMIterator 内部用来聚合设备元数据的 map,键是 std::shared_ptr,但没有使用按设备值比较的 comparator,默认按指针地址比较。
结果就是:同一个逻辑设备(比如 d1)如果来自不同恢复轮次、指针不同,会被当成不同 key。
在 TSMIterator 的设备聚合 map 上使用 IDeviceIDComparator,让 key 比较按设备内容而不是指针地址。
English
Inside
TSMIterator, the map used to aggregate device metadata usesstd::shared_ptr<IDeviceID>as the key, but it does not use a value-based comparator for devices; by default, it compares pointer addresses.As a result, the same logical device (for example,
d1) coming from different recovery rounds can have different pointer instances and be treated as different keys.The fix is to use
IDeviceIDComparatorfor the device-aggregation map inTSMIterator, so keys are compared by device identity/content instead of pointer address.