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>
This is needed to allow an atomic compare and update operation
from the rebuild object map utility.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
It will verify the object map is properly sized, verify
the existence of each object within the image (snapshot),
and clear the invalid object map flag once complete.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
If the object map is corrupt on-disk or too small for the image,
correct these basic issues as soon as possible. The object map
is still flagged as invalid, but there will be less required repair
work if future IO is able to properly update the object map.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
resize, flatten, and rebuild object map now use the same
bootstrap code for sending the request to the remote lock owner
or executing the request locally.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>