After enabling object map or fast diff, flag those features as
invalid. When disabling features, remove the associated invalid
flags.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Since fast diff can be enabled/disabled independently from the object
map, it's important to track when the fast diff portion of the object
map is invalid.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Since older Ceph clients that support exclusive locking won't
support snap_remove, only attempt to proxy the command if
fast diff is enabled.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The fast diff algorithm can only flag an object as deleted if
the full object is discarded -- not just a small section.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The fast diff algorithm reads all object maps between the from/to
snapshot ids and computes when the object was changed/removed.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
When a snapshot is added, mark all HEAD image objects that exist as clean.
When a snapshot is removed, mark all clean objects that were dirty in the
deleted snapshot as dirty.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Throw an error if the fast diff feature is enabled w/o the
object map -- or if the object map is disabled while fast
diff is still enabled.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
object_map_snap_add is invoked after creating a new snapshot to flag
all in-use HEAD objects within as clean. object_map_snap_remove is
invoked after a snapshot is removed in order to clear the clean flag
on all in-use objects.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
A new feature is required to track images that are properly tracking
object deltas between snapshots.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
In order to support merging dirty object metadata from
snapshot object maps, it is now required to coordinate this
activity through the exclusive lock owner.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The rbd CLI can now use the object map to compute the diffs between
two snapshots. This option is enabled with the new '--object-extents'
option.
Fixes: #7787
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
New diff_iterate API supports skipping parent images and reporting
the object extents for an object that has been modified. The latter
will be helpful in providing an optimized diff method that can use
the object map to quickly compute object diffs between snapshots.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
When the cluster is stuck (wait_for_clean times out), display ceph
report to stderr for debugging purposes.
Signed-off-by: Loic Dachary <ldachary@redhat.com>
It is not enough for the backports to be available, they also need to be
explicitly allowed to take precedence whenever a package is installed
indirectly. This is causing problems with libp11-kit-dev pulled by
libcurl4-gnutls-dev.
Signed-off-by: Loic Dachary <ldachary@redhat.com>
This will allow clients to detect that the object map is no longer
invalid and to reload the object map from disk.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Allow the object map rebuild process to build the full object map
in memory and save it to disk with one operation.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
If a client of librados_test_stub modified a bufferlist
retrieved via a read call, the client will actually be
changing the contents of the file. Therefore, read calls
should deep-copy the contents of the buffer::ptrs.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Rebuild will need to be able to update/resize the object maps
for image snapshots. This was previously not permitted.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
When multiple IO updates are occurring within the same object, this
will allow only a single object map update request to be sent to the
OSD.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Acquiring the lock on a missing object map will create an
empty object. Treat the empty object as a non-existant
object map to support rebuilding corrupt object maps while
holding the exclusive lock.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>