Skip to content

crimson/seastore: add dirty extent writeout - #36779

Merged
tchaikov merged 29 commits into
ceph:masterfrom
athanatos:sjust/wip-dirty-writeout
Sep 26, 2020
Merged

tchaikov merged 29 commits into
ceph:masterfrom
athanatos:sjust/wip-dirty-writeout

Conversation

@athanatos

Copy link
Copy Markdown
Contributor

No description provided.

@athanatos
athanatos requested a review from tchaikov August 25, 2020 05:29
@athanatos
athanatos requested a review from a team as a code owner August 25, 2020 05:29

@tchaikov tchaikov 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 am still reviewing.

Comment thread src/crimson/os/seastore/transaction.h Resolved
Comment thread src/crimson/os/seastore/cache.cc Resolved
Comment thread src/crimson/os/seastore/cache.cc Resolved
Comment thread src/crimson/os/seastore/cache.cc Resolved
Comment thread src/crimson/os/seastore/cache.cc Resolved
@athanatos
athanatos force-pushed the sjust/wip-dirty-writeout branch from 956791c to db4cff7 Compare September 21, 2020 17:55
This went undetected because all existing users ensure that
the key does not already exist.

Signed-off-by: Samuel Just <[email protected]>
Otherwise, different users may use different values complicating
debugging.  We can re-add this in the future if it becomes
useful.

Signed-off-by: Samuel Just <[email protected]>
Most handling remains special, but this way the dirty list we
work on will include root directly.

Signed-off-by: Samuel Just <[email protected]>
…pending

If it's already pending, cache.duplicate_for_write is a noop and the extent
will already have a pin.  Also, add some debugging.

Signed-off-by: Samuel Just <[email protected]>
Previously, all extents ended up initialized to the same crc value
upon read -- the one for an empty buffer.  This bug wasn't detected
because an extent was always evicted and reread following the first
write and subsequently kept in cache once initially written.

Also, add crc to operator<< for extents.

Signed-off-by: Samuel Just <[email protected]>
find_hole shouldn't check entries prior to min.

Signed-off-by: Samuel Just <[email protected]>
…ay if dead

Dead extents can't go through the normal retire_extent path as they don't
have valid pins or other elements of a real extent.  Instead, simply drop
them on the floor directly.

Signed-off-by: Samuel Just <[email protected]>
This way, we'll roll segments more frequently.

Signed-off-by: Samuel Just <[email protected]>
…ate on block relative addrs

Signed-off-by: Samuel Just <[email protected]>
…dr for extent state

Addresses must always be adjusted depending on whether the extent will
be written as a block or as a delta.

Signed-off-by: Samuel Just <[email protected]>
I'm not sure why I added this in the first place, there aren't really
any scenarios where invoking it wouldn't be a bug.

Signed-off-by: Samuel Just <[email protected]>
Previously, we simply added the old extent to the retired set and
treated the new instance seperately.  Instead, let the new pending
instance reference the old instance via a prior_instance reference.
This has a few advantages:
- During commit, we swap cache hooks from the prior instance to
  avoid traversal
- Extents in the retired set are only those extents that are no
  longer mapped/valid.
- btree range pins can be swapped without a traversal
- position in the dirty list can be maintained

That last will be particularly important as the dirty list will
therefore be ordered from the extent with the oldest initial
delta forward.

Signed-off-by: Samuel Just <[email protected]>
Reworks journal_seq_t to be a monotonically increasing, but non-dense
value from the current segment_seq_t and segment offset.

Signed-off-by: Samuel Just <[email protected]>
@athanatos
athanatos force-pushed the sjust/wip-dirty-writeout branch from db4cff7 to ceac766 Compare September 23, 2020 23:06
Comment thread src/crimson/os/seastore/cache.cc Resolved
Comment thread src/crimson/os/seastore/cache.cc Resolved
@athanatos

Copy link
Copy Markdown
Contributor Author

The make check failure is because I made a mistake in updating test_extmap_manager when I rebased, fixing.

@athanatos
athanatos force-pushed the sjust/wip-dirty-writeout branch from ceac766 to ba3535e Compare September 24, 2020 19:07
@athanatos

Copy link
Copy Markdown
Contributor Author

Pulled a fix for the unittest_extmap_manager crash from sjust/wip-seastore-gc

Comment thread src/crimson/os/seastore/cached_extent.h Resolved
Comment thread src/crimson/os/seastore/cache.cc Resolved
Comment thread src/crimson/os/seastore/cache.cc Resolved
We'll need this to track where extents became dirty during replay.

Signed-off-by: Samuel Just <[email protected]>
If we see a delta at verison v (v != 0) and we haven't seen version v-1,
we know that the extent is obsolete and can be ignored (presuming that
journal trimming is behaving).

Signed-off-by: Samuel Just <[email protected]>
Adds support for writing out an extent to a new location and updating
lba mappings.

Signed-off-by: Samuel Just <[email protected]>
Adds SegmentCleaner component to manage rewriting
dirty segments.

Signed-off-by: Samuel Just <[email protected]>
…test

Also improves replay() by recycling all structures except for the
segment_manager.

Signed-off-by: Samuel Just <[email protected]>
@athanatos
athanatos force-pushed the sjust/wip-dirty-writeout branch from ba3535e to 9ab4acd Compare September 25, 2020 20:14
@tchaikov
tchaikov merged commit 52bab35 into ceph:master Sep 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants