Skip to content

test: fix TierFlushDuringFlush to wait until dedup_tier is set on base pool#45035

Merged
yuriw merged 1 commit intoceph:masterfrom
ssdohammer-sl:bug-fix-TierFlushDuringFlush
Mar 3, 2022
Merged

test: fix TierFlushDuringFlush to wait until dedup_tier is set on base pool#45035
yuriw merged 1 commit intoceph:masterfrom
ssdohammer-sl:bug-fix-TierFlushDuringFlush

Conversation

@ssdohammer-sl
Copy link
Contributor

@ssdohammer-sl ssdohammer-sl commented Feb 15, 2022

When start_dedup() is called while the base pool is not set the dedup_tier,
it is not possible to know the target pool of the chunk object.

  1. User set the dedup_tier on a base pool by mon_command().
  2. User issues tier_flush on the object which has a manifest (base pool)
    before the dedup_tier is applied on the base pool.
  3. OSD calls start_dedup() to flush the chunk objects to chunk pool.
  4. OSD calls get_dedup_tier() to get the chunk pool of the base pool,
    but it is not possible to know the chunk pool.
  5. get_dedup_tier() returns 0 because it is not applied on the base pool yet.
  6. This makes refcount_manifest() lost it's way to chunk pool.

To prevent this issue, start_dedup() has to be called after dedup_tier is set
on the base pool. To do so, this commit prohibits getting chunk pool id if
dedup_tier is not set.

Fixes: http://tracker.ceph.com/issues/53855

Signed-off-by: Sungmin Lee sung_min.lee@samsung.com

Checklist

  • References tracker ticket
  • No impact that needs to be tracked
  • Includes bug reproducer
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

@ljflores
Copy link
Member

jenkins test api

@ljflores
Copy link
Member

jenkins test make check

@ssdohammer-sl ssdohammer-sl force-pushed the bug-fix-TierFlushDuringFlush branch from 96c790f to 6932880 Compare February 18, 2022 02:49
@github-actions github-actions bot added the core label Feb 18, 2022
// check if dedup_tier isn't set
if (oloc.pool <= 0) {
dout(10) << __func__ << " failed to get pool info of the chunk object" << dendl;
return hobject_t();
Copy link
Contributor

Choose a reason for hiding this comment

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

The caller doesn't check for hobject_t() as a return value. The assert here was fine, but start_dedup needs to check for the validity of oloc.pool and return an error that will actually be propagated to the client from the CEPH_OSD_OP_CACHE_FLUSH case. We also need a test for that case to confirm that the correct error gets propagated.

Copy link
Contributor

Choose a reason for hiding this comment

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

Returning an hobject_t() is not a valid way to signal an error. get_fpoid_from_chunk() should not be called in the first place if the dedup tier isn't set. Please check this in start_dedup prior to calling get_fpoid_from_chunk and put the assert back.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for further explanation. I misunderstood what you intended.
Changed to check dedup_tier is set in start_dedup and put assert back in get_fpoid_from_chunk.

@ssdohammer-sl ssdohammer-sl force-pushed the bug-fix-TierFlushDuringFlush branch from 6932880 to 4f6f1e3 Compare February 18, 2022 08:05
result = -EAGAIN;
else if (result == -EINVAL)
goto fail;
} else {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is needed here because op is CEPH_OSD_OP_CACHE_FLUSH---not related to dedup work.

@ssdohammer-sl ssdohammer-sl force-pushed the bug-fix-TierFlushDuringFlush branch 2 times, most recently from efca14b to 6e5a8c7 Compare February 22, 2022 02:33
for (auto p : chunks) {
hobject_t target = mop->new_manifest.chunk_map[p.first].oid;
if (refs.find(target) == refs.end()) {
if (target.get_hash() == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This check is incorrect, 1 in 1<<32 objects will have a hash of 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. Thank you for explanation.
It was a depreciated check which was intended to handle former bug fix before you commented.
So, I should have removed this code in advance.
Sorry for confusing you.

if (refs.find(target) == refs.end()) {
if (target.get_hash() == 0) {
return -EINVAL;
}
Copy link
Member

Choose a reason for hiding this comment

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

This change is not necessary. What is the purpose of this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change should have been removed in advance, but it was my mistake.
Sorry for confusing you.

…e pool

When start_dedup() is called while the base pool is not set the dedup_tier,
it is not possible to know the target pool of the chunk object.

1. User set the dedup_tier on a base pool by mon_command().
2. User issues tier_flush on the object which has a manifest (base pool)
  before the dedup_tier is applied on the base pool.
3. OSD calls start_dedup() to flush the chunk objects to chunk pool.
4. OSD calls get_dedup_tier() to get the chunk pool of the base pool,
  but it is not possible to know the chunk pool.
5. get_dedup_tier() returns 0 because it is not applied on the base pool yet.
6. This makes refcount_manifest() lost it's way to chunk pool.

To prevent this issue, start_dedup() has to be called after dedup_tier is set
on the base pool. To do so, this commit prohibits getting chunk pool id if
dedup_tier is not set.

Fixes: http://tracker.ceph.com/issues/53855

Signed-off-by: Sungmin Lee <sung_min.lee@samsung.com>
@ssdohammer-sl ssdohammer-sl force-pushed the bug-fix-TierFlushDuringFlush branch from 6e5a8c7 to 66ad91e Compare February 24, 2022 01:40
@athanatos
Copy link
Contributor

retest this please

@athanatos athanatos self-requested a review February 24, 2022 04:24
@athanatos
Copy link
Contributor

Ok, that looks reasonable. Thanks for taking the time to track down and fix it!

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.

6 participants