mirror of
https://github.com/ceph/ceph
synced 2026-08-02 07:03:18 +00:00
osd/ECOmapJournal: bind by reference when clearing omap keys
The clear_omap loop bound each key_map entry by value, so
update_value() mutated a copy and cached keys were never marked
removed.
As a result, clear_omap had no effect on already-cached keys: cleared
omap keys retained stale values and were returned on read.
Introduced-by: 7289e4d2ec ("osd: Add ECOmapJournal class and relocate OmapUpdateType enum class")
Fixes: https://tracker.ceph.com/issues/77750
Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn>
This commit is contained in:
parent
f3dcff54f5
commit
aa82faec86
@ -234,7 +234,7 @@ void ECOmapJournal::process_entries(const hobject_t &hoid) {
|
||||
// Clear omap if specified
|
||||
if (entry_iter->clear_omap) {
|
||||
// Mark all keys as removed
|
||||
for (auto [_, value] : key_map[hoid]) {
|
||||
for (auto &[_, value] : key_map[hoid]) {
|
||||
value.update_value(entry_iter->version, std::nullopt);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user