Skip to content

os/bluestore: Provide backup and restore for bluestore db - #48029

Closed
YiteGu wants to merge 1 commit into
ceph:mainfrom
YiteGu:backup-and-restore-for-osd-db
Closed

YiteGu wants to merge 1 commit into
ceph:mainfrom
YiteGu:backup-and-restore-for-osd-db

Conversation

@YiteGu

@YiteGu YiteGu commented Sep 9, 2022

Copy link
Copy Markdown
Member

If have a function what we can backup rocksdb of bluetore, and then we can use backup db to restore db when db damage. At now, osd block device disk is a 16TB HDD, if have one of db happend damage, we have to destroyed and redeployed osd, and then have a 16TB data need to backfill, but block device is intact. If we can restore db by backup, we don't need to redeployed osd, just backfill a little data.

Signed-off-by: Yite Gu [email protected]

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
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 dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

@YiteGu
YiteGu requested a review from a team as a code owner September 9, 2022 06:31
@YiteGu

YiteGu commented Sep 9, 2022

Copy link
Copy Markdown
Member Author

For example:

  1. backup db
$ ./bin/ceph -c ceph.conf daemon /tmp/ceph-asok.AzMRMW/osd.0.asok db_backup ~/vstar_osd/
$ tree ~/vstar_osd/
/home/work/vstar_osd/
├── meta
│   └── 1
├── private
│   └── 1
│       ├── 000009.log
│       ├── CURRENT
│       ├── MANIFEST-000008
│       └── OPTIONS-000011
└── shared
    ├── 000004.sst
    └── 000007.sst
  1. db damage, can't open db, restart osd daemon failed:
2022-09-05 17:32:45.656 7f738c7eea80 -1 bluestore(/root/gyt/ceph/build/dev/osd0) _open_db erroring opening db:
2022-09-05 17:32:46.653 7f738c7eea80 -1 osd.0 0 OSD:init: unable to mount object store
2022-09-05 17:32:46.653 7f738c7eea80 -1  ** ERROR: osd init failed: (5) Input/output error
  1. restore db
$ ./bin/ceph-kvstore-tool -c ceph.conf bluestore-kv ./dev/osd0/ db-restore ~/vstar_osd

restart osd daemon is OK.

$ /root/gyt/ceph/build/bin/ceph-osd -i 0 -c /root/gyt/ceph/build/ceph.conf
2022-09-05 17:50:47.931 7fc477176a80 -1 Falling back to public interface
2022-09-05 17:50:50.193 7fc477176a80 -1 osd.0 15 log_to_monitors {default=true}
$ ./bin/ceph -c ceph.conf -s
  cluster:
    id:     447f7ea5-bcca-4d0f-a83e-e4a0d0d89b1f
    health: HEALTH_WARN
            Reduced data availability: 5 pgs inactive

  services:
    mon: 3 daemons, quorum a,b,c (age 24m)
    mgr: x(active, since 24m)
    mds: 1/1 daemons up, 2 standby
    osd: 3 osds: 3 up (since 9s), 3 in (since 9s)

  data:
    volumes: 1/1 healthy
    pools:   3 pools, 65 pgs
    objects: 22 objects, 2.3 KiB
    usage:   3.0 GiB used, 300 GiB / 303 GiB avail
    pgs:     36.923% pgs not active
             41 active+clean
             24 activating

  progress:
    Global Recovery Event (0s)
      [............................]

@YiteGu
YiteGu force-pushed the backup-and-restore-for-osd-db branch 2 times, most recently from 7d355d5 to 0ea9112 Compare September 9, 2022 08:29
@github-actions github-actions Bot added the tests label Sep 9, 2022
@ifed01 ifed01 changed the title osd: Provide backup and restore for bluestore db os/bluestore: Provide backup and restore for bluestore db Sep 9, 2022
@YiteGu
YiteGu force-pushed the backup-and-restore-for-osd-db branch from 0ea9112 to 25cfeda Compare September 9, 2022 10:00
@YiteGu

YiteGu commented Sep 14, 2022

Copy link
Copy Markdown
Member Author

Hi, @ifed01, what do you think about this PR

If have a function what we can backup rocksdb of bluetore,
and then we can use backup db to restore db when db damage.
At now, osd block device disk is a 16TB HDD, if have one
of db happend damage, we have to destroyed and redeployed osd,
and then have a 16TB data need to backfill, but block device
is intact. If we can restore db by backup, we don't need to
redeployed osd, just backfill a little data.

Signed-off-by: Yite Gu <[email protected]>
@ifed01

ifed01 commented Sep 30, 2022

Copy link
Copy Markdown
Contributor

Hi, @ifed01, what do you think about this PR

Hi @YiteGu - good feature!
But IMO it needs some wrapping at BlueStore/BlueFS level to make is more robust/reliable.
I made another PR which includes and wraps your commit. It adds BlueFS/DB reinitialization prior to issuing a restore. Plus some other tricks which helped me while I was playing with your commit in my lab.
Additionally I moved backup/restore to ceph-bluestore-tool and rename them to export/import. Online backup via admin socket is left untouched though.
Hope you wouldn't mind that extension..

Here is the new PR: #48309

@YiteGu

YiteGu commented Oct 14, 2022

Copy link
Copy Markdown
Member Author

Hi, @ifed01 I already test your PR: #48309 in my lab, that's good. :)

@markhpc

markhpc commented Oct 17, 2022

Copy link
Copy Markdown
Member

@YiteGu @ifed01 I'm a little terrified of this PR to be honest. :) It feels like we are sort of hijacking the recovery process here in ways it wasn't really designed for. @ifed01 Do you feel confident this is really something we could expose to users?

@ifed01

ifed01 commented Oct 19, 2022

Copy link
Copy Markdown
Contributor

Hi @markhpc - could you please elaborate on your concerns? What is wrong with the recovery process usage here?

@ifed01

ifed01 commented Oct 20, 2022

Copy link
Copy Markdown
Contributor

Hi @markhpc - could you please elaborate on your concerns? What is wrong with the recovery process usage here?

btw, Mark,. have you seen an updated PR: #48309 ?

@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 May 28, 2023
@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions github-actions Bot closed this Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants