Skip to content

rbd incremental backup/restore - #169

Merged
liewegas merged 54 commits into
masterfrom
wip-rbd-diff
Apr 1, 2013
Merged

liewegas merged 54 commits into
masterfrom
wip-rbd-diff

Conversation

@liewegas

Copy link
Copy Markdown
Member

No description provided.

Sage Weil added 30 commits March 31, 2013 23:32
It is important to know the latest seq that the object has seen in order
to tell if a response like

 clone 2 snaps=[1,2]
 clone head snaps=[]

was untouched before a hypothetical snap 3, or deleted prior to snap 3,
and then recreated+modified after.

Signed-off-by: Sage Weil <[email protected]>
If there is a sequence of snaps 1, 2, 3, 4, 5, and we have a clone
2 with [1,2], and the head reflects content at snap times [3,4,5], then
the snap_list should return

 clone 2 snaps [1,2]
 head snaps
 seq 2

because it never saw a write after snap 2, and therefor has the same
content currently as it did in snaps 3,4,5.  If the SnapSet on the
object lists snaps 3,4,5, and the head exists, it actually means the
object was deleted between 2 and 3, and was recreated after 5:

 clone 2 snaps [1,2]
 head snaps []
 seq 5

The key to telling the two situations apart is the seq number on the
SnapSet (now included in the list_snaps reply) that tells us when the
last update was.

Signed-off-by: Sage Weil <[email protected]>
The list_snaps operation needs to look at the SnapSet, and is logically
querying all revisions of the object.  Make requests to SNAPDIR be
read-only, and grab the head or snapdir obc transparently (whichever one
exists).  This allows us to list snaps when, say, the head does not
exist, but there are in fact snaps.

Signed-off-by: Sage Weil <[email protected]>
Wait for all clones to be present.

Signed-off-by: Sage Weil <[email protected]>
We need to return the list of snaps that each clone is defined for, not
the list of snaps we know may or may not exist globally over a similar
interval.  This requires looking at the clone's obc, unfortunately.

Signed-off-by: Sage Weil <[email protected]>
Implement a diff_iterate() method that will iterate over an image and
report which extents vary between two snapshots (or a snapshot and the
head).  The callback gets an extent and a flag indicating whether it is
full of data or is known to be zero in the ending snapshot.

Signed-off-by: Sage Weil <[email protected]>
Write to random offsets instead of sequentially.

Signed-off-by: Sage Weil <[email protected]>
Export a diff of an image from a previous snapshot to a file (or stdout).

Import a diff and apply it to an image, and then create the ending
snapshot.

Signed-off-by: Sage Weil <[email protected]>
Stress test that does io on an image while we are mirroring a diff from
earlier snaps to a second copy.  At the end, verify that all snaps have
matching content.

Signed-off-by: Sage Weil <[email protected]>
If we have a parent image, and the reference is from snap 0 (beginning of
time) we need to look at the diff on the parent from the beginning of time
and report that when we get an ENOENT.

Signed-off-by: Sage Weil <[email protected]>
Report extents allocated/changed, and whether they contain data or zeros.

Signed-off-by: Sage Weil <[email protected]>
Get a bit of coverage on clones by starting with a clone.

Signed-off-by: Sage Weil <[email protected]>
This code is confusing because we are moving back and forth between
image offsets, "buffer" offsets (image offsets relative to off), and
object offsets.  Fix the math.

Signed-off-by: Sage Weil <[email protected]>
Exercise the striping arithmetic by using non-standard striping that
varies between the parent and child.

Signed-off-by: Sage Weil <[email protected]>
We were using the internal CEPH_NOSNAP and CEPH_SNAPDIR constants, and
defining a clone_info_t::HEAD (with a different value).  The docs were
referrring to the internal constant names.

Instead, define librados constants (C and C++) with the same values as the
internal types.

Note that this changes the clone_info_t::HEAD value from -1 to -2 so that
it now matches the internal type.

Signed-off-by: Sage Weil <[email protected]>
This is most closely related to the librados list_snaps API; move it there.

Signed-off-by: Sage Weil <[email protected]>
This is a much more convenient way to tell if a snapshot already exists.

Signed-off-by: Sage Weil <[email protected]>
Sage Weil and others added 23 commits March 31, 2013 23:32
This will prevent a user from inadvertantly reapplying a diff twice.

Signed-off-by: Sage Weil <[email protected]>
This avoids interfering when export is sent to stdout.

Signed-off-by: Sage Weil <[email protected]>
This will be jumpy since changed extents probably aren't evenly
distributed, but it's better than nothing.

Signed-off-by: Josh Durgin <[email protected]>
The diff format gives us a size, so unlike a normal import, we do update progress.

Signed-off-by: Josh Durgin <[email protected]>
…xpected

safe_read() just protects against EINTR, and may return less data than
requested if it reaches the end of the file. Use safe_read_exact() to
make sure we get the right amount of data.

Signed-off-by: Josh Durgin <[email protected]>
Use int instead of bool for the callback, and make it represent
whether the data exists, rather than the opposite, since callers
are likely to test for whether it's data instead of whether its zeroes.

Change the return value to 0, since an int64_t will wrap around
for large reads, and there's no value in reporting the length
read when it will always be the length requested clipped to the
size of the image.

Signed-off-by: Josh Durgin <[email protected]>
Without this, the same seed is used each time, so multiple runs
of bench-write with the same parameters have the same I/O pattern.

Signed-off-by: Josh Durgin <[email protected]>
This is a bit more helpful than -EINVAL.

Signed-off-by: Josh Durgin <[email protected]>
All the other commands that display information have this.
For consistency, add it to this command too.

Also switch the plain output to use a TextTable for better readability.

Signed-off-by: Josh Durgin <[email protected]>
They're useless, and trigger an assert in interval_set::inesrt.

Signed-off-by: Josh Durgin <[email protected]>
The python interface is a bit awkward since it maps directly
to the C interface, but it'll work well enough and not use
tons of memory.

Signed-off-by: Josh Durgin <[email protected]>
discard, flush, and striping info slipped through the cracks before,
but are useful and trivial to add.

Signed-off-by: Josh Durgin <[email protected]>
Fixes build on 32-bit archs.

Signed-off-by: Sage Weil <[email protected]>
liewegas pushed a commit that referenced this pull request Apr 1, 2013
rbd incremental backup/restore

Reviewed-by: Josh Durgin <[email protected]>
@liewegas
liewegas merged commit 557685f into master Apr 1, 2013
@liewegas
liewegas deleted the wip-rbd-diff branch April 1, 2013 18:26
liewegas pushed a commit that referenced this pull request Dec 14, 2016
Removed client upgrade, fixes #9642

Reviewed-by: Josh Durgin <[email protected]>
liewegas pushed a commit that referenced this pull request Dec 14, 2016
kernel: use utsrelease string for need_to_install() purposes
liewegas added a commit to liewegas/ceph that referenced this pull request Nov 5, 2021
…metry-to-users

ceph.io/users: add telemetry dashboard
andriytk pushed a commit to andriytk/cortx-rgw that referenced this pull request May 3, 2022
…bject (ceph#169)

Problem:
Unexpected EOF is seen while downloading large (e.g. 5GB) object.
This was due to incorrect variable type(unsigned int) chosen for storing
object size and offset. As the limit of unsigned int is 0 to 4294967296(4GB),
an overflow happened when 5GB is assigned to it. This overflow sets value of
~1GB in the variable, causing server to return only ~1GB data to client
during Get API, further causing unexpected EOF on client side.

Resolution:
Use higher order int variable type, say int64_t, to store object size
and other data offset values.

Signed-off-by: Dattaprasad Govekar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants