test: fix TierFlushDuringFlush to wait until dedup_tier is set on base pool#45035
Conversation
|
jenkins test api |
|
jenkins test make check |
96c790f to
6932880
Compare
src/osd/PrimaryLogPG.cc
Outdated
| // 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(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
6932880 to
4f6f1e3
Compare
| result = -EAGAIN; | ||
| else if (result == -EINVAL) | ||
| goto fail; | ||
| } else { |
There was a problem hiding this comment.
I don't think this is needed here because op is CEPH_OSD_OP_CACHE_FLUSH---not related to dedup work.
efca14b to
6e5a8c7
Compare
src/osd/PrimaryLogPG.cc
Outdated
| 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) { |
There was a problem hiding this comment.
This check is incorrect, 1 in 1<<32 objects will have a hash of 0.
There was a problem hiding this comment.
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.
src/osd/PrimaryLogPG.cc
Outdated
| if (refs.find(target) == refs.end()) { | ||
| if (target.get_hash() == 0) { | ||
| return -EINVAL; | ||
| } |
There was a problem hiding this comment.
This change is not necessary. What is the purpose of this?
There was a problem hiding this comment.
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>
6e5a8c7 to
66ad91e
Compare
|
retest this please |
|
Ok, that looks reasonable. Thanks for taking the time to track down and fix it! |
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.
before the dedup_tier is applied on the base pool.
but it is not possible to know the 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
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume tox