Skip to content

Fix multi-recovery metadata indexing and add regression coverage.#783

Merged
jt2594838 merged 1 commit intoapache:developfrom
hongzhi-gao:fix/cpp-restorable-writer
Apr 16, 2026
Merged

Fix multi-recovery metadata indexing and add regression coverage.#783
jt2594838 merged 1 commit intoapache:developfrom
hongzhi-gao:fix/cpp-restorable-writer

Conversation

@hongzhi-gao
Copy link
Copy Markdown
Contributor

中文

TSMIterator 内部用来聚合设备元数据的 map,键是 std::shared_ptr,但没有使用按设备值比较的 comparator,默认按指针地址比较。
结果就是:同一个逻辑设备(比如 d1)如果来自不同恢复轮次、指针不同,会被当成不同 key。
在 TSMIterator 的设备聚合 map 上使用 IDeviceIDComparator,让 key 比较按设备内容而不是指针地址。

English

Inside TSMIterator, the map used to aggregate device metadata uses std::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 IDeviceIDComparator for the device-aggregation map in TSMIterator, so keys are compared by device identity/content instead of pointer address.

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 jt2594838 merged commit 3de49f7 into apache:develop Apr 16, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants