Merge pull request #50615 from batrick/i59119

mds: respawn standby-replay if read_pos is <= expire_pos

Reviewed-by: Venky Shankar <vshankar@redhat.com>
This commit is contained in:
Venky Shankar 2023-11-03 16:59:36 +05:30 committed by GitHub
commit 59f5087aa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1816,7 +1816,11 @@ public:
void MDSRank::_standby_replay_restart_finish(int r, uint64_t old_read_pos)
{
if (old_read_pos < mdlog->get_journaler()->get_trimmed_pos()) {
auto trimmed_pos = mdlog->get_journaler()->get_trimmed_pos();
dout(20) << __func__ << ":"
<< " old_read_pos=" << old_read_pos
<< " trimmed_pos=" << trimmed_pos << dendl;
if (old_read_pos < trimmed_pos) {
dout(0) << "standby MDS fell behind active MDS journal's expire_pos, restarting" << dendl;
respawn(); /* we're too far back, and this is easier than
trying to reset everything in the cache, etc */