osd: full-object read crc is mismatch, because truncate modify oi.siz…#43902
Closed
jiawd wants to merge 3 commits intoceph:masterfrom
Closed
osd: full-object read crc is mismatch, because truncate modify oi.siz…#43902jiawd wants to merge 3 commits intoceph:masterfrom
jiawd wants to merge 3 commits intoceph:masterfrom
Conversation
…e and forget to clear data_digest when write before truncate, need trim length, if truncate is to 0, write is [0~128k], write change to [0~0], do nothing, oi.size is 0, x1 = set_data_digest(crc32(-1)). write is [128k~128k], write change to [128k~0], truncate oi.size to offset 128k, x2 = set_data_digest(crc32(x1)). write is [256k~128k], write change to [256k~0], truncate oi.size to offset 256k, x3 = set_data_digest(crc32(x2)). ... write is [4063232~128k], write change to [4063232~0], truncate oi.size to offset 4063232, xn = set_data_digest(crs32(xn-1)) Now, we can see oi.size is 4063232, and data_digest is 0xffffffff, because thelength of in_data of crc is 0 every time. when read verify crc will reply EIO. (EC pool). so, when truncate in write, need clear data_digest and DIGEST flag, when write before truncate, need to trim length, when offset over than oi.size, don't truncate oi.size to offset. Fixes: https://tracker.ceph.com/issues/53240 Signed-off-by: jiawd <jiawendong@xtaotech.com>
Fixes: https://tracker.ceph.com/issues/53240 Signed-off-by: jiawd <jiawendong@xtaotech.com>
Fixes: https://tracker.ceph.com/issues/53240 Signed-off-by: jiawd <jiawendong@xtaotech.com>
14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…e and forget to clear data_digest
when write before truncate, need trim length, if truncate is to 0,
write is [0
128k], write change to [00], do nothing, oi.size is 0, x1 = set_data_digest(crc32(-1)).write is [128k
128k], write change to [128k0], truncate oi.size to offset 128k, x2 = set_data_digest(crc32(x1)).write is [256k
128k], write change to [256k0], truncate oi.size to offset 256k, x3 = set_data_digest(crc32(x2))....
write is [4063232
128k], write change to [40632320], truncate oi.size to offset 4063232, xn = set_data_digest(crs32(xn-1))Now, we can see oi.size is 4063232, and data_digest is 0xffffffff, because thelength of in_data of crc is 0 every time.
when read verify crc will reply EIO. (EC pool).
so, when truncate in write, need clear data_digest and DIGEST flag,
when write before truncate, need to trim length, when offset over than oi.size, don't truncate oi.size to offset.
Fixes: https://tracker.ceph.com/issues/53240
Signed-off-by: jiawd jiawendong@xtaotech.com