mds: scrub fix#6
Conversation
280aec3 to
3fdcc5b
Compare
3fdcc5b to
9e16a8e
Compare
a9a992f to
81d0299
Compare
1. remote link damage identification with reverse parent scrubbing
- remote link identification becomes tricky if inode is cached.
- Try to open the link normally, if issue while opening mark as damaged
- If openned successfully, it can be possible there is damage but inode
is cached that's why it is succssful while opening. In that case take
that openned inode, and scrub ancestors recursively. If any of the ancestor
is damaged it remote link is marked as damaged.
- while scrubbing some flag is maintained in the inode,
e.g. whether scrub is backward or forward or both
- his backward scrubbing will only work in read-only scrub that means
without repair flag and mds_scrub_hard_link this ceph flag is turned on.
- A new type of damage introduced, using which multiple links point to same
inode can be identified, which was not possible previously.
2. mds_damage_log_to_file and mds_damage_log_file is used to print out damages
in a file persistently as it's not safe to keep it in memory
Signed-off-by: Md Mahamudur Rahaman Sajib <mahamudur.sajib@croit.io>
Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
…crub Also update ignorelist with the expected cluster warning. Fixes: https://tracker.ceph.com/issues/69345 Signed-off-by: Md Mahamudur Rahaman Sajib <mahamudur.sajib@croit.io> (cherry picked from commit 13eb6c6)
3efad5c to
d9ddfd5
Compare
…damage-file candidate selection, type filtering, and bounded window controls (`--extent-period`, `--extent-limit`) into DataScan while preserving legacy full-scan behavior. Add cls-assisted accumulated-metadata flushing semantics and robust CephFS QA fixtures/tests that validate manual expectations, inode/damage parity, multi-pool edge cases, and argument validation with deterministic QA coverage. Signed-off-by: Md Mahamudur Rahaman Sajib <mahamudur.sajib@croit.io>
d9ddfd5 to
4fa1e49
Compare
3a3e0de to
057ae50
Compare
Signed-off-by: Md Mahamudur Rahaman Sajib <mahamudur.sajib@croit.io>
Signed-off-by: Md Mahamudur Rahaman Sajib <mahamudur.sajib@croit.io>
55f6b5b to
b7cf88a
Compare
Signed-off-by: Md Mahamudur Rahaman Sajib <mahamudur.sajib@croit.io>
| std::string damage_file_path; | ||
| std::string damage_type_expr; | ||
| std::vector<std::string> damage_type_tokens; | ||
| bool damage_type_filter_set; |
There was a problem hiding this comment.
Looks redundant, could be replaced with damage_type_tocken.size()
| std::string damage_type_expr; | ||
| std::vector<std::string> damage_type_tokens; | ||
| bool damage_type_filter_set; | ||
| bool damage_type_all; |
There was a problem hiding this comment.
Isn't that always equal to !damage_type_filter_set ?
| // Parser state for scan_extents damage/inode inputs. | ||
| std::string damage_file_path; | ||
| std::string damage_type_expr; | ||
| std::vector<std::string> damage_type_tokens; |
| bool damage_type_all; | ||
| std::string inode_file_path; | ||
| uint64_t extent_period; | ||
| bool extent_period_set; |
There was a problem hiding this comment.
IMO redundant, extent_period == 0 should be sufficient to indicate unset val
There was a problem hiding this comment.
I am keeping the default value of extent_period = 1 such that if someone doesn't add that parameter then default value will be kept. But also I want to protect other commands having extent_period. That's why a sanity boolean is used.
| uint64_t extent_period; | ||
| bool extent_period_set; | ||
| uint64_t extent_limit; | ||
| bool extent_limit_set; |
| librados::IoCtx &ctx, inodeno_t inode_no, const uint64_t obj_index, | ||
| const uint64_t obj_size, const int64_t obj_pool_id, const time_t mtime, | ||
| AccumulateResult *accum_res, const bool immediate_write) { | ||
| if (!immediate_write) { |
There was a problem hiding this comment.
Why are you extending accumulate_inode_metadata() interface with two additional parameter to perform completely different in-mem accumulation instead of having/using standalone method, e.g. AccumulatedResult::update_accumulate_result or something.
| const uint64_t obj_size, const int64_t obj_pool_id, const time_t mtime, | ||
| AccumulateResult *accum_res, const bool immediate_write) { | ||
| if (!immediate_write) { | ||
| if (accum_res == nullptr) { |
There was a problem hiding this comment.
IMO one can assert here and get rid off any return value
| r = ClsCephFSClient::accumulate_inode_metadata(data_io, ino, extent_id, | ||
| size, obj_pool_id, mtime, | ||
| &accum_res, false); | ||
| if (r < 0) { |
There was a problem hiding this comment.
One can get rid off any error handling here if using standalone update_accumulate_result() method for in-mem update as per my comment above.
| return ctx.operate(zeroth_object.name, &op); | ||
| } | ||
|
|
||
| int ClsCephFSClient::flush_inode_accumulate_result( |
There was a problem hiding this comment.
I have a feeling that everything this function does could be performed through the original accumulate_inode_metadata() call. Am I missing something?
If thats' the case then all these new code to support set_accumulated_inode_metadata method and its parameter structure could be removed.
There was a problem hiding this comment.
Actually it won't be possible (I also initially think that way). Let's assume a case where no chunk exist but the hard_link (basically as dentry) exist. In that case I would like to create a fake inode using force_create_head_inode to resolve the issue. We could remove that dentry from omap as well but it would cause extra corruption in link count. Those fake inode eventually will go into directory lost+found (check scan_inode_from_oid function).
| } | ||
| } | ||
|
|
||
| if (!window_productive && all_stat_failed) { |
There was a problem hiding this comment.
Isn't window_production check redundant here? IIUC when all_stat_failed is true window_productive is always false.
| uint64_t obj_name_offset, | ||
| bool force_restore_ancestors, | ||
| std::unordered_set<uint64_t> &&inode_set) { | ||
| if (force_restore_ancestors && |
There was a problem hiding this comment.
do we really need this check here or we can rely on the same inside inject_with_backtrace?
There was a problem hiding this comment.
Did you mean the cycle check is unnecessary or the whole scan_frag_from_oid call inside inject_with_backtrace is unnecessary?
| // should be fixed up using a separate tool scanning the metadata | ||
| // pool. | ||
| break; | ||
| if (force_inject_ancestors) { |
There was a problem hiding this comment.
Is the comment above still valid with the new code?
There was a problem hiding this comment.
This will not be true according to the code I did. When I found a dir_frag, I used that directory inode object's backtrace to restore not the outdated backtrace of child inode.
There was a problem hiding this comment.
My argument here is, if this idea have risk then whole scan_frags is in risk.
Signed-off-by: Md Mahamudur Rahaman Sajib mahamudur.sajib@croit.io
is cached that's why it is succssful while opening. In that case take
that openned inode, and scrub ancestors recursively. If any of the ancestor
is damaged it remote link is marked as damaged.
e.g. whether scrub is backward or forward or both
without repair flag and mds_scrub_hard_link this ceph flag is turned on.
inode can be identified, which was not possible previously.
in a file persistently as it's not safe to keep it in memory
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.