]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw: during GC defer, prevent new GC enqueue 38228/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Sat, 21 Nov 2020 16:10:35 +0000 (11:10 -0500)
committerJ. Eric Ivancich <ivancich@redhat.com>
Sat, 21 Nov 2020 18:52:16 +0000 (13:52 -0500)
commit2603485bcb4402260e0f7aadd2f2c8ab05b07399
tree510c0e8bfea1bebba426a024a1f7415b9b4485ce
parent4040082610b25990e9e6ca0d0e891e8e0dce574c
rgw: during GC defer, prevent new GC enqueue

With the new queue-based GC code, when a GC defer operation is
performed, it adds an "urgent" record to prevent GC from removing
objects that are still being read. It does not check whether the
objects are on the GC queue or not and that's OK for the urgent
record.

The code *also* adds a new GC entry to the queue to cause GC to occur
at a later time. This would be incorrect if there was no GC entry to
begin with, however. In such a case this would cause GC to delete tail
objects when no user-initiated remove has happend. In other words a
READ could cause a DELETE of tail objects and therefore data loss.

This fix prevents such a new GC entry from being enqueued, thus
preventing the data loss in this rare case. There is a new risk that
tail object orphans to be created, but as an immediate fix to prevent
data loss, this is appropriate and it is a rare event. A follow-on PR
that will handle these cases is likely.

This PR adds a level 0 log entry as a way to potentially confirm this
case is being triggered in real-world cases. In time, this log entry
should be deleted.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
src/cls/rgw_gc/cls_rgw_gc.cc