Skip to content

rbd: rbd export/import for consistent group - #40808

Open
wangshuaich wants to merge 3 commits into
ceph:mainfrom
wangshuaich:rbd-export-import-consistent-group-feature
Open

wangshuaich wants to merge 3 commits into
ceph:mainfrom
wangshuaich:rbd-export-import-consistent-group-feature

Conversation

@wangshuaich

@wangshuaich wangshuaich commented Apr 12, 2021 •

Copy link
Copy Markdown
Contributor

Export data from a consistent group to a file, and import data from a file to a consistent group, both incremental and full, in a manner similar to import and export of image.

Added four new commands:

rbd group export [--pool <pool>] [--namespace <namespace>] 
                        [--group <group>] [--path <path>] [--no-progress] 
                        <source-group-spec> <path-name> 
rbd group export-diff [--pool <pool>] [--namespace <namespace>] 
                         [--group <group>] [--snap <snap>] 
                         [--from-snap <from-snap>] [--whole-object] 
                         [--path <path>] [--no-progress] 
                         <source-group-or-snap-spec> <path-name>
rbd group import [--path <path>] [--dest-pool <dest-pool>] 
                        [--dest-namespace <dest-namespace>] 
                        [--dest-group <dest-group>] 
                        [--image-format <image-format>] [--new-format] 
                        [--order <order>] [--object-size <object-size>] 
                        [--image-feature <image-feature>] [--image-shared] 
                        [--stripe-unit <stripe-unit>] 
                        [--stripe-count <stripe-count>] 
                        [--data-pool <data-pool>] 
                        [--mirror-image-mode <mirror-image-mode>] 
                        [--journal-splay-width <journal-splay-width>] 
                        [--journal-object-size <journal-object-size>] 
                        [--journal-pool <journal-pool>] 
                        [--sparse-size <sparse-size>] [--no-progress] 
                        <path-name> <dest-group-spec>
rbd group import-diff [--path <path>] [--dest-pool <dest-pool>] 
                         [--dest-namespace <dest-namespace>] 
                         [--dest-group <dest-group>] 
                         [--image-format <image-format>] [--new-format] 
                         [--order <order>] [--object-size <object-size>] 
                         [--image-feature <image-feature>] 
                         [--image-shared] [--stripe-unit <stripe-unit>] 
                         [--stripe-count <stripe-count>] 
                         [--data-pool <data-pool>] 
                         [--mirror-image-mode <mirror-image-mode>] 
                         [--journal-splay-width <journal-splay-width>] 
                         [--journal-object-size <journal-object-size>] 
                         [--journal-pool <journal-pool>] 
                         [--sparse-size <sparse-size>] [--no-progress] 
                         <path-name> <dest-group-spec>

The format of the full export file:

RBD_GROUP_BANNER
group_snap_diff_num(group_snap_num + 1)
  for{
    RBD_GROUP_BANNER_SNAP
    RBD_DIFF_FROM_SNAP
    RBD_DIFF_TO_SNAP
    RBD_EXPORT_IMAGE_END
      RBD_GROUP_BANNER_DIFF
      image_num_in_this_group_diff
        for{
          RBD_GROUP_BANNER_IMAGE_INFO
          RBD_EXPORT_GROUP_IMAGE_POOL_NAME
          RBD_EXPORT_GROUP_IMAGE_NAME
          RBD_EXPORT_GROUP_IMAGE_ID
          RBD_EXPORT_GROUP_IS_CREATE_IMAGE
          RBD_EXPORT_IMAGE_END
            if new add image in this diff{
              RBD_IMAGE_BANNER_V2
              RBD_EXPORT_IMAGE_ORDER
              RBD_EXPORT_IMAGE_FEATURES
              RBD_EXPORT_IMAGE_STRIPE_UNIT
              RBD_EXPORT_IMAGE_STRIPE_COUNT
              RBD_EXPORT_IMAGE_META
              RBD_EXPORT_IMAGE_END
            }
              RBD_DIFF_BANNER
              RBD_DIFF_IMAGE_SIZE
              image_data
              RBD_DIFF_END
        }
  }

The format of the incremental export file:

RBD_GROUP_BANNER_SNAP
RBD_DIFF_FROM_SNAP
RBD_DIFF_TO_SNAP
RBD_EXPORT_IMAGE_END
  RBD_GROUP_BANNER_DIFF
  image_num_in_this_group_diff
    for{
      RBD_GROUP_BANNER_IMAGE_INFO
      RBD_EXPORT_GROUP_IMAGE_POOL_NAME
      RBD_EXPORT_GROUP_IMAGE_NAME
      RBD_EXPORT_GROUP_IMAGE_ID
      RBD_EXPORT_GROUP_IS_CREATE_IMAGE
      RBD_EXPORT_IMAGE_END
        if new add image in this diff{
          RBD_IMAGE_BANNER_V2
          RBD_EXPORT_IMAGE_ORDER
          RBD_EXPORT_IMAGE_FEATURES
          RBD_EXPORT_IMAGE_STRIPE_UNIT
          RBD_EXPORT_IMAGE_STRIPE_COUNT
          RBD_EXPORT_IMAGE_META
          RBD_EXPORT_IMAGE_END
        }
          RBD_DIFF_BANNER
          RBD_DIFF_IMAGE_SIZE
          image_data
          RBD_DIFF_END
    }

Fixes: https://tracker.ceph.com/issues/18864

Signed-off-by: Wang ShuaiChao [email protected]

Review-by: [email protected]
Review-by: [email protected]

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

@wangshuaich
wangshuaich force-pushed the rbd-export-import-consistent-group-feature branch from 6b4ac96 to 6312526 Compare April 13, 2021 06:00
@wangshuaich
wangshuaich requested a review from a team as a code owner April 13, 2021 06:00

@trociny trociny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@wangshuaich Cool!

I just glanced through it. What was the reason to introduce group_import_set/get cls methods?

And the PR seems to include 3 not related PRs. Probably just needs rebase?

Comment thread src/include/rbd/librbd.hpp Resolved
Comment thread src/librbd/api/Group.h Resolved
@github-actions

Copy link
Copy Markdown

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

@wangshuaich

Copy link
Copy Markdown
Contributor Author

@wangshuaich Cool!

I just glanced through it. What was the reason to introduce group_import_set/get cls methods?

And the PR seems to include 3 not related PRs. Probably just needs rebase?

There are multiple images in a group
group_import_set/get cls is to record the corresponding relationship
between exported image id and imported image id

If not, there are two problems:

  1. Image names may be different in different snapshots
export_group  export_group@v1
image1        image1 --> image1_new(image1_new will not be found on import)
image2        image2 --> image2_new(image1_new will not be found on import)
  1. If you change the name of the imported image during
    the import process, subsequent incremental imports will fail
import_group   change import image name       import_group@v1
image1         image1 --> image3              can 't find image1
image2         image2 --> image4              can 't find image2

@trociny

trociny commented Apr 19, 2021

Copy link
Copy Markdown
Contributor

group_import_set/get cls is to record the corresponding relationship
between exported image id and imported image id

I think I see the problem but I still don't like the idea of these new cls methods. I'd like we avoid storing import specific information in images. Though I need to think we can do here.

I suppose the same problem exist with v2 image import/export, but with the snapshots, if they are renamed?

One of solutions I guess could be extend the group_snapshot_create to store not only image_ids but also image names, so you could add this info in the export file.

@wangshuaich

Copy link
Copy Markdown
Contributor Author

group_import_set/get cls is to record the corresponding relationship
between exported image id and imported image id

I think I see the problem but I still don't like the idea of these new cls methods. I'd like we avoid storing import specific information in images. Though I need to think we can do here.

I suppose the same problem exist with v2 image import/export, but with the snapshots, if they are renamed?

One of solutions I guess could be extend the group_snapshot_create to store not only image_ids but also image names, so you could add this info in the export file.

I see. I can remove the cls methods and put the information in the export file.

@batrick batrick removed the cephfs Ceph File System label Apr 20, 2021
@wangshuaich

Copy link
Copy Markdown
Contributor Author

group_import_set/get cls is to record the corresponding relationship
between exported image id and imported image id

I think I see the problem but I still don't like the idea of these new cls methods. I'd like we avoid storing import specific information in images. Though I need to think we can do here.

I suppose the same problem exist with v2 image import/export, but with the snapshots, if they are renamed?

One of solutions I guess could be extend the group_snapshot_create to store not only image_ids but also image names, so you could add this info in the export file.

delete cls methods:
group_import_set
group_import_get

https://github.com/ceph/ceph/pull/40808/commits/2d9ce1cb92b62a8d9d80629203b2563f13c34605

@sebastian-philipp
sebastian-philipp removed the request for review from a team April 23, 2021 08:49

@idryomov idryomov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There are three unrelated commits in the "Commits" list as well as a bunch of merge commits. Please get rid of them by rebasing on top of latest master. (When incorporating master changes into a PR, it is usually better to rebase than to merge.)

@wangshuaich
wangshuaich force-pushed the rbd-export-import-consistent-group-feature branch from 1853a83 to ed3654d Compare April 28, 2021 04:02
@wangshuaich

Copy link
Copy Markdown
Contributor Author

There are three unrelated commits in the "Commits" list as well as a bunch of merge commits. Please get rid of them by rebasing on top of latest master. (When incorporating master changes into a PR, it is usually better to rebase than to merge.)

Hello!I have dealt with the problem.

Comment thread src/librbd/librbd.cc Resolved
Comment thread src/librbd/api/Group.cc Resolved
Comment thread src/librbd/api/Group.cc Resolved
Comment thread src/librbd/api/Group.cc Resolved
@trociny

trociny commented Apr 28, 2021

Copy link
Copy Markdown
Contributor

@wangshuaich You seemed to squash all your commits into one. You were asked just to get rid off not yours commits.

I would still prefer if you provided a separate commit for cls, API, and CLI.

@wangshuaich

Copy link
Copy Markdown
Contributor Author

@wangshuaich You seemed to squash all your commits into one. You were asked just to get rid off not yours commits.

I would still prefer if you provided a separate commit for cls, API, and CLI.
@trociny
I'm sorry!I consider this feature as a whole, so I removed the CLS, API, and CLI commit information, and it was difficult for me to recover the CLS, API, and CLI commit information.

@trociny trociny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I still want you to split it into librbd API commit and rbd CLI commit.

Comment thread src/include/rbd/librbd.hpp Resolved
Comment thread src/include/rbd/librbd.hpp Resolved
Comment thread src/include/rbd/librbd.hpp Resolved
Comment thread src/include/rbd/librbd.hpp Resolved
Comment thread src/librbd/librbd.cc Resolved
Comment thread src/librbd/librbd.cc Resolved
@trociny

trociny commented May 12, 2021

Copy link
Copy Markdown
Contributor

I still want you to split it into librbd API commit and rbd CLI commit.

And for librbd API, I would prefer group_image_snap_list in one commit and diff_iterate in another.

Also you need both C and C++ versions, and ideally the python API (pybind/rbd/rbd.pyx) too. Though you can skip the python API if you are not comfortable working on it.

@trociny

trociny commented May 12, 2021

Copy link
Copy Markdown
Contributor

And adding some unit tests for API and functional tests for CLI would be nice too.

@github-actions github-actions Bot added the stale label Oct 21, 2023
@idryomov idryomov removed the stale label Oct 22, 2023
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Dec 21, 2023
@idryomov idryomov removed the stale label Dec 21, 2023
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Feb 19, 2024
@idryomov idryomov removed the stale label Feb 19, 2024
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Apr 19, 2024
@idryomov idryomov removed the stale label Apr 19, 2024
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Jun 18, 2024
@idryomov idryomov removed the stale label Jun 18, 2024
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Aug 17, 2024
@idryomov idryomov removed the stale label Aug 17, 2024
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Oct 16, 2024
@idryomov idryomov removed the stale label Oct 16, 2024
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Dec 15, 2024
@idryomov idryomov removed the stale label Dec 16, 2024
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Feb 14, 2025
@idryomov idryomov added pinned Use this label if you want to exempt a PR from being stalled and removed stale labels Feb 14, 2025
@jmundack

jmundack commented Nov 5, 2025

Copy link
Copy Markdown
Contributor

@idryomov - Do we want to keep this open? (its been a while since any work has been done - shall we close this out or figure out next steps?)

@idryomov

idryomov commented Nov 5, 2025

Copy link
Copy Markdown
Contributor

Do we want to keep this open?

Yes, I'd prefer for all RBD PRs with pinned label, no matter how inactive/old, to remain open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build/ops documentation needs-rebase pinned Use this label if you want to exempt a PR from being stalled pybind rbd tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants