if no peers zones are configured to sync from us, we can safely trim
our entire log. start with the marker '
99999999' (which compares larger
than any key based on a timestamp) instead of an empty marker, then take
the minimum of that with any peer markers
Fixes: http://tracker.ceph.com/issues/39487
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit
da3803f59fcf904ec32e6e03d2dedc23d0a127f8)
Conflicts:
src/rgw/rgw_trim_datalog.cc
- file does not exist in mimic; made the changes manually in
src/rgw/rgw_data_sync.cc
num_shards(num_shards),
zone_id(store->get_zone().id),
peer_status(store->zone_conn_map.size()),
- min_shard_markers(num_shards),
+ min_shard_markers(num_shards, "99999999"),
last_trim(last_trim)
{}
}
}
- min_markers.resize(std::max(1u, bucket_info.num_shards));
+ // initialize each shard with the maximum marker, which is only used when
+ // there are no peers syncing from us
+ min_markers.assign(std::max(1u, bucket_info.num_shards), "99999999");
// determine the minimum marker for each shard
retcode = take_min_status(cct, peer_status.begin(), peer_status.end(),