Skip to content

os/bluestore: incremental update mode for bluefs log - #42750

Merged
neha-ojha merged 4 commits into
ceph:masterfrom
aclamk:wip-aclamk-bluefs-log-incremental
Dec 21, 2021
Merged

neha-ojha merged 4 commits into
ceph:masterfrom
aclamk:wip-aclamk-bluefs-log-incremental

Conversation

@aclamk

@aclamk aclamk commented Aug 11, 2021

Copy link
Copy Markdown
Contributor

This PR is a part of discussion on best approach to introducing new OP to bluefs replay log - incremental update.
Incremental update OP_FILE_UPDATE_INC is similar to OP_FILE_UPDATE, but skips encoding extents that have already been encoded in previous bluefs transactions. In most cases it significantly reduces bluefs growth rate.

It is based on #42734.
Notable differences:

  1. dedicated type bluefs_fnode_delta_t type is created for OP_FILE_UPDATE_INC
  2. newly allocated extents are stored in separate collection (preparation for refactor of vselector, to reduce add_usage/sub_usage pattern)
  3. offset field allows to make sure that our new extents are being truly appended to file (no holes/overlaps)

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

@aclamk

aclamk commented Aug 12, 2021

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@ifed01

ifed01 commented Aug 12, 2021

Copy link
Copy Markdown
Contributor

'make check' failures look relevant, store_test fails in the same way, see ino 0 at line -3:
-8> 2021-08-12T14:17:42.603+0300 7fb6cc2f0200 10 bluefs _replay 0x1000: txn(seq 2 len 0xb0 crc 0x87c32807)
-7> 2021-08-12T14:17:42.603+0300 7fb6cc2f0200 20 bluefs _replay 0x1000: op_dir_create db
-6> 2021-08-12T14:17:42.603+0300 7fb6cc2f0200 20 bluefs _replay 0x1000: op_dir_create db.slow
-5> 2021-08-12T14:17:42.603+0300 7fb6cc2f0200 20 bluefs _replay 0x1000: op_dir_create db.wal
-4> 2021-08-12T14:17:42.603+0300 7fb6cc2f0200 20 bluefs _replay 0x1000: op_file_update_inc delta(ino 2 size 0x0 mtime 2021-08-12T14:17:42.076398+0300 offset
0 extents [])
-3> 2021-08-12T14:17:42.603+0300 7fb6cc2f0200 20 bluefs _replay 0x1000: op_file_update_inc produced file(ino 0 size 0x0 mtime 0.000000 allocated 0 extents [
])
-2> 2021-08-12T14:17:42.603+0300 7fb6cc2f0200 20 bluefs _replay 0x1000: op_dir_link db/LOCK to 2
-1> 2021-08-12T14:17:42.619+0300 7fb6cc2f0200 -1 ../src/os/bluestore/BlueFS.cc: In function 'int BlueFS::_replay(bool, bool)' thread 7fb6cc2f0200 time 2021-08
-12T14:17:42.607137+0300
../src/os/bluestore/BlueFS.cc: 1284: FAILED ceph_assert(file->fnode.ino)

Comment thread src/os/bluestore/BlueFS.cc Resolved
Comment thread src/os/bluestore/BlueFS.cc Outdated

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.

you're enforcing incremental update at this point - I'm not sure that's a valid behavior, full metadata snapshot to be created here.

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.

ah, nevermind. This produces incremental updates for dirty files only

@aclamk
aclamk force-pushed the wip-aclamk-bluefs-log-incremental branch from 81356c2 to ecced7f Compare August 12, 2021 11:40
Comment thread src/os/bluestore/BlueFS.cc Resolved
Comment thread src/os/bluestore/BlueFS.cc Outdated

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 don't like fnode's fields assignment scattered over the code. Looks like ino and mtime fields could be assigned along with size one below... Ideally it would be done via some class method, not directly...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We need fnode.ino being set above sub_usage and fnode.size being set below sub_usage.
Only thing is that I can do is move them closer together.

Comment thread src/os/bluestore/bluefs_types.h Outdated

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.

nit: new_extents_size can be tracked at bluefs_fnode_t on adding new extent, no need to reiterate over the new_extents then.

Comment thread src/os/bluestore/bluefs_types.h Outdated

@ifed01 ifed01 Aug 12, 2021 •

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.

nit: I'd like to avoid new_extents copying here and may be swap delta.extents and file.new_extents or something. file.new_extents are cleared anyway afterwards.
Something more elegant than doing that swap explicitly here is preferred though..
May be delta to be produced and filled by bluefs_fnode_t instance, e.g. via bluefs_fnode_t::make_delta or bluefs_fnode_t::branch_delta_off method?
This would eliminate the need to call clear_incremental_extents each time as well.

@ifed01 ifed01 changed the title Incremental update mode for bluefs log os/bluestore: incremental update mode for bluefs log Aug 13, 2021
@aclamk
aclamk force-pushed the wip-aclamk-bluefs-log-incremental branch 3 times, most recently from c51af0c to 6c17ff4 Compare August 18, 2021 14:26
@aclamk aclamk removed the DNM label Aug 18, 2021
@aclamk
aclamk requested a review from ifed01 August 18, 2021 14:45
Comment thread src/os/bluestore/bluefs_types.h Resolved
Comment thread src/os/bluestore/BlueFS.cc Resolved
@aclamk
aclamk force-pushed the wip-aclamk-bluefs-log-incremental branch from 6c17ff4 to 42204b0 Compare August 20, 2021 09:07
@aclamk
aclamk requested a review from ifed01 August 20, 2021 09:08
Comment thread src/os/bluestore/BlueFS.cc Resolved
@aclamk

aclamk commented Sep 21, 2021

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@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

@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

@github-actions github-actions Bot added the tests label Nov 24, 2021
@aclamk
aclamk force-pushed the wip-aclamk-bluefs-log-incremental branch from d26d457 to cd83171 Compare November 24, 2021 18:11
Comment thread src/os/bluestore/BlueFS.cc Resolved
Comment thread src/os/bluestore/BlueFS.cc Resolved
Comment thread src/os/bluestore/bluefs_types.h Resolved
@aclamk
aclamk force-pushed the wip-aclamk-bluefs-log-incremental branch from cd83171 to bc12af7 Compare December 10, 2021 14:03
@ifed01

ifed01 commented Dec 14, 2021

Copy link
Copy Markdown
Contributor

Good to go!

@aclamk

aclamk commented Dec 15, 2021

Copy link
Copy Markdown
Contributor Author

@ifed01 One more change went into the PR.
I forgot to track bluefs log in noop mode.

Comment thread src/os/bluestore/BlueFS.cc Outdated

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.

nit: check for noop is redundant

@aclamk
aclamk force-pushed the wip-aclamk-bluefs-log-incremental branch from a582cc8 to 8cb1faf Compare December 15, 2021 12:15
@yuriw

yuriw commented Dec 20, 2021 •

Copy link
Copy Markdown
Contributor

@aclamk pls rebase

@yuriw

yuriw commented Dec 20, 2021

Copy link
Copy Markdown
Contributor

Ready for merge

From @aclamk
https://pad.ceph.com/p/akupczyk-teuthology-analysis
There are failures, but none seem related to PR at hand.

ifed01 and others added 4 commits December 20, 2021 21:55
…lueFS log

Added test that verifies that in update mode we properly pick up delta.
BlueFS log is the only file that can be appended to, but it is done in very indirect way.

Signed-off-by: Adam Kupczyk <[email protected]>
BlueFS log is the only file that we can append to.
When we append to file we must take into consideration previously commited allocations,
otherwise update will be miscalculated.

Signed-off-by: Adam Kupczyk <[email protected]>
Keep updating bluefs log when printing content of bluefs replay log.
Without this modification we only have initial content of log.
Log can be printed by 'ceph-bluestore-tool bluefs-log-dump'.

Signed-off-by: Adam Kupczyk <[email protected]>
@aclamk
aclamk force-pushed the wip-aclamk-bluefs-log-incremental branch from 8cb1faf to 2292a4d Compare December 20, 2021 22:43
@neha-ojha
neha-ojha merged commit 1f28c06 into ceph:master Dec 21, 2021
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.

5 participants