Conversation
| } else if (in->scrub_info()->forward_scrub) { | ||
| bool added_children = false; | ||
| bool done = false; // it's done, so pop it off the stack | ||
| scrub_dir_inode(in, &added_children, &done); | ||
| if (done) { | ||
| dout(20) << __func__ << " dir inode, done" << dendl; | ||
| in->set_forward_scrub(false); | ||
| dequeue(in); | ||
| } | ||
| if (added_children) { | ||
| // dirfrags were queued at top of stack | ||
| it = scrub_stack.begin(); | ||
| } |
There was a problem hiding this comment.
@ifed01 regarding this comment #5 (comment)
Shouldn't we call scrub_dir_inode_final(in) here if (!remote_links().empty()) ?
if (!remote_links.empty) then inside scrub_dir_inode it will call scrub_dir_inode_final(in) and handle the backward scrub there.
There was a problem hiding this comment.
hmm... But calling scrub_dir_inode_final() would happen before forward_scrub is cleared so it would be a no-op in regard to remote links, nor?
280aec3 to
3fdcc5b
Compare
3fdcc5b to
9e16a8e
Compare
For scrubbing dirfrag we are pushing children back into the scrub stack. Instead we can follow the same strategy for scrub directory and pushing children front of the scrub stack, and in kick_off_scrubs always start scrubbing from the front of the stack. It will prevent ScrubStack to pinning whole level of the file-system tree. Fixes: https://tracker.ceph.com/issues/71167 Signed-off-by: Md Mahamudur Rahaman Sajib <mahamudur.sajib@croit.io>
Fixes: https://tracker.ceph.com/issues/68611 Signed-off-by: Md Mahamudur Rahaman Sajib <mahamudur.sajib@croit.io>
9e16a8e to
14e62d3
Compare
| - name: mds_scrub_hard_link | ||
| type: bool | ||
| level: advanced | ||
| desc: force scrubbing hard link |
There was a problem hiding this comment.
IMO better rephrase to "force hard link scrubbing"
| void set_log_to_file(bool _log_to_file) { | ||
| log_to_file = _log_to_file; | ||
| if (log_to_file) { | ||
| open_damage_log_file(fout, log_file); |
There was a problem hiding this comment.
May be bettet to check for non_empty log_file before calling open_damage_log_file() to avoid redundant errors on empy file opening attempt in the log.
| in->scrub_reset_remote_links(); | ||
|
|
||
| if (in->scrub_info()->forward_scrub) { | ||
| _enqueue(in, header, true); |
There was a problem hiding this comment.
I don't understand why do we need to enqueue it once again here - IIUC this will effectively do nothing as remote_links are emty and in->scrub_is_in_progress() == true
There was a problem hiding this comment.
And if this block is removed then scrub_reset_remote_links() call above is redundant as well.
There was a problem hiding this comment.
First of all scrubbing operation are not parallel in mds side, it parallalize the I/O towards osd only.
void *MDSRank::ProgressThread::entry()
{
std::unique_lock l(mds->mds_lock);
while (true) {
cond.wait(l, [this] {
return (mds->stopping ||
!mds->finished_queue.empty() ||
(!mds->waiting_for_nolaggy.empty() && !mds->beacon.is_laggy()));
});
if (mds->stopping) {
break;
}
mds->_advance_queues();
}
return NULL;
}
This progress thread runs every task sequentially and under big mds_lock
I don't understand why do we need to enqueue it once again here
Let's say forward_scrub is false, in that case it will scrub backwards. Now for a specific inode it sends request to osd through in->validate_disk_state(&fin->result, fin);. This I/O is asynchronous. So in this async I/O, what if in between some directory recursed through that inode and tries to enqeue it for forward scrubbing. But as scrub is in progress (asynchronously) it won't push that inode into the queue but make forward_scrub = true here.
int ScrubStack::_enqueue(
MDSCacheObject *obj, ScrubHeaderRef &header, bool top, bool *added,
std::vector<std::pair<std::string, inodeno_t>> &&remote_links) {
ceph_assert(ceph_mutex_is_locked_by_me(mdcache->mds->mds_lock));
if (CInode *in = dynamic_cast<CInode*>(obj)) {
if (in->scrub_is_in_progress()) {
dout(10) << __func__ << " with {" << *in << "}" << ", already in scrubbing" << dendl;
if (!remote_links.empty()) {
in->scrub_add_remote_link(std::move(remote_links));
} else {
in->set_forward_scrub(true);
}
return -CEPHFS_EBUSY;
}
There was a problem hiding this comment.
You are right. We need to make scrub_is_in_progress false before _enqueue call
14e62d3 to
59e5062
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>
59e5062 to
de31182
Compare
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.