Bug #81779
closedrgw: set_olh() passes log_data_change as update_olh()'s null_verid, tagging bilog deletes as null-version
0%
Description
Problem¶
The fix for #55179 (commit 485020f97b08 "rgw/multisite: add a flag to bilog_flags and use it to set/unset null version", PR #58133) added bool null_verid = false ahead of bool log_op = true in RGWRados::update_olh(). The two calls in RGWRados::set_olh() were not updated and still pass log_data_change as the last positional argument:
update_olh(dpp, obj_ctx, state, bucket_info, olh_obj, y, zones_trace, log_data_change);
log_data_change therefore binds to null_verid, and log_op always takes its default true. Both are bool, so this compiles without a warning.
Affected: main (rgw_rados.cc:10271, 10292), tentacle (9566, 9587), squid since the #62309 backport (8731, 8752).
Effect¶
- In multisite,
log_data_changeis true for versioned PUTs and delete-marker creation, and always true on the sync fetch path. So wheneverset_olh()callsupdate_olh(),null_veridis true.apply_olh_log()then deletes each pendingREMOVE_INSTANCEentry withnull_verid=true, and the resultingCLS_RGW_OP_DELbilog entries carryRGW_BILOG_NULL_VERSION.RGWBucketSyncSingleEntryCRon the peer rewrites such an entry's key toinstance="null". log_opis always true, so these removals are logged even when the caller passedlog_data_change=false.
Seen on a two-zone vstart cluster: on a versioning-suspended bucket, a plain DELETE over an existing null version writes del a[""] with bilog_flags=3 (VERSIONED_OP | NULL_VERSION). With the arguments passed explicitly it writes bilog_flags=1. In this case the removed instance really is the null version, and the peer squashes the del behind the preceding link_olh_del, so the zones don't diverge.
From code inspection, not reproduced: if set_olh() applies a leftover REMOVE_INSTANCE for a non-null version (for example after a racing version delete), and that del reaches the peer without being squashed, the peer removes its null version instead.
Fix¶
Pass both arguments explicitly in set_olh():
update_olh(dpp, obj_ctx, state, bucket_info, olh_obj, y, zones_trace, false /* null_verid */, log_data_change);
KC Updated by Krunal Chheda about 2 months ago
- Backport set to tentacle, squid
KC Updated by Krunal Chheda about 2 months ago
- Pull request ID set to 72708
KC Updated by Krunal Chheda about 2 months ago
- Status changed from New to Fix Under Review
- Assignee set to Krunal Chheda
- Backport changed from tentacle, squid to tentacle, squid, umbrella
UB Updated by Upkeep Bot about 1 month ago
- Copied to Backport #82600: tentacle: rgw: set_olh() passes log_data_change as update_olh()'s null_verid, tagging bilog deletes as null-version added
UB Updated by Upkeep Bot about 1 month ago
- Copied to Backport #82601: squid: rgw: set_olh() passes log_data_change as update_olh()'s null_verid, tagging bilog deletes as null-version added
UB Updated by Upkeep Bot about 1 month ago
- Copied to Backport #82602: umbrella: rgw: set_olh() passes log_data_change as update_olh()'s null_verid, tagging bilog deletes as null-version added
UB Updated by Upkeep Bot about 1 month ago
- Status changed from Fix Under Review to Backporting
- Merge Commit set to fa3cb18bc567df15819b0d0dea2111bd0d8f39de
- Fixed In set to v22.0.0-339-gfa3cb18bc5
- Upkeep Timestamp set to 2026-11-03T09:39:47+00:00