Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cephfs-mirror: incremental sync #40831

Merged
merged 6 commits into from May 27, 2021

Conversation

vshankar
Copy link
Contributor

@vshankar vshankar commented Apr 13, 2021

Requires PR #40810 to build and use.

Snap data is incrementally transferred to remote file system based on mtime/ctime differences. This does away with cleaning up remote file system data on each snap sync. Whenever possible, changes are identified by scanning local snapshot pair. On the other hand, when last synced ("previous") snapshot cannot be used for comparison, changes are identified by comparing "current" snapshot data to remote filesystem directory root (for the directory in question).

Also, this relies to *at() libcephfs APIs to ensure correctness of the snapshot being synchronized FTW.

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

@vshankar vshankar added the cephfs Ceph File System label Apr 13, 2021
@github-actions github-actions bot added the tests label Apr 13, 2021
@vshankar vshankar force-pushed the wip-cephfs-mirror-incremental-sync branch 2 times, most recently from c12519f to 06f677c Compare April 13, 2021 05:55
@vshankar vshankar requested review from a team, batrick and mchangir April 13, 2021 06:53
@vshankar
Copy link
Contributor Author

Build failures are due to requirement of PR #40810.

@batrick
Copy link
Member

batrick commented Apr 13, 2021

./tasks/cephfs/test_mirroring.py:907:19: F541 f-string is missing placeholders
./tasks/cephfs/test_mirroring.py:947:13: F841 local variable 'p' is assigned to but never used

Copy link
Contributor

@mchangir mchangir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a nit

src/tools/cephfs_mirror/PeerReplayer.h Outdated Show resolved Hide resolved
@vshankar vshankar force-pushed the wip-cephfs-mirror-incremental-sync branch 2 times, most recently from b7c0246 to f9487d9 Compare May 3, 2021 04:24
@github-actions
Copy link

github-actions bot commented May 4, 2021

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@batrick
Copy link
Member

batrick commented May 4, 2021

... and rebased again

@vshankar vshankar force-pushed the wip-cephfs-mirror-incremental-sync branch from f9487d9 to 6428018 Compare May 5, 2021 12:23
@vshankar
Copy link
Contributor Author

vshankar commented May 5, 2021

rebase and updated -- also included changes to sync file mode.

Copy link
Contributor

@mchangir mchangir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small request

src/tools/cephfs_mirror/PeerReplayer.cc Outdated Show resolved Hide resolved
@vshankar vshankar force-pushed the wip-cephfs-mirror-incremental-sync branch from 6428018 to 127779c Compare May 11, 2021 12:16
@github-actions
Copy link

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

Purpose of this xattr is to identify if the "next" snapshot to be
synchronized can be incrementally transferred. Value of the xattr
is the snap-id of a snapshot in the primary cluster (for a given
directory root).

CephFS mirror daemon sets this xattr on the directory root once
the data for a snapshot is synchronized, thereby signifying that
the data under this directory root is the data of the snapshot
identified by the snap-id value. This allows the mirror daemon
to use the much efficient selective synchronzation (based on
mtime/ctime) by scanning the two snapshots locally and only
transferring the inodes that have changed.

Signed-off-by: Venky Shankar <vshankar@redhat.com>
…any remote (sub)directory

Right now, the only path to cleanup (purge) is the remote file
system directory root (for configured snapshot directories).
With incremental sync, we would need the ability to cleanup
selective directories under configured snapshot directories.
Furthermore, the path passed to the function ise used to checking
if the mirror daemon needs to backoff due to mirroring being
disabled, daemon shutdown etc.

So, adjust the function prototype to accept the directory root
and the relative path to be cleaned up under this directory.

Signed-off-by: Venky Shankar <vshankar@redhat.com>
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Use incremental transfer when the data on the remote file system
for a given directory root is belongs to the snapshot which can
be used for local comparison.

Files are chosen based on mtime changes.

Signed-off-by: Venky Shankar <vshankar@redhat.com>
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Fixes: http://tracker.ceph.com/issues/49939
Signed-off-by: Venky Shankar <vshankar@redhat.com>
@vshankar vshankar force-pushed the wip-cephfs-mirror-incremental-sync branch from 127779c to da9788a Compare May 25, 2021 12:46
@vshankar
Copy link
Contributor Author

Copy link
Contributor

@mchangir mchangir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit

src/tools/cephfs_mirror/PeerReplayer.cc Outdated Show resolved Hide resolved
Copy link
Contributor

@mchangir mchangir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mchangir mchangir merged commit 26fbbef into ceph:master May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cephfs Ceph File System tests
Projects
None yet
3 participants