diff options
author | Venky Shankar <vshankar@redhat.com> | 2024-07-16 06:14:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-16 06:14:54 +0200 |
commit | f4ac1f435c2ac1f241eca7df3f105d52bd11d6d9 (patch) | |
tree | a6a66ea3eb0dba59306004e5b76a4c35115e1411 /src | |
parent | Merge pull request #58517 from phlogistonjohn/jjm-cephadm-ranked-by-spec (diff) | |
parent | osdc/Journaler: derr log and abort when header update get (possibly) overwrit... (diff) | |
download | ceph-f4ac1f435c2ac1f241eca7df3f105d52bd11d6d9.tar.xz ceph-f4ac1f435c2ac1f241eca7df3f105d52bd11d6d9.zip |
Merge pull request #55265 from vshankar/wip-58878
osdc/Journaler: derr log when header update get (possibly) overwritten out-of-order
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Dhairya Parmar <dparmar@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/osdc/Journaler.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/osdc/Journaler.cc b/src/osdc/Journaler.cc index 04b90fb5952..c1c1178bd7f 100644 --- a/src/osdc/Journaler.cc +++ b/src/osdc/Journaler.cc @@ -493,7 +493,21 @@ void Journaler::_finish_write_head(int r, Header &wrote, } ceph_assert(!readonly); ldout(cct, 10) << "_finish_write_head " << wrote << dendl; - last_committed = wrote; + if (wrote.write_pos < last_committed.write_pos || + wrote.expire_pos < last_committed.expire_pos || + wrote.trimmed_pos < last_committed.trimmed_pos) { + lderr(cct) << __func__ << ": not updating last_committed: " + << "(wrote.write_pos/last_committed.write_pos=" + << wrote.write_pos << "," << last_committed.write_pos << "), " + << "(wrote.expire_pos/last_committed.expire_pos=" + << wrote.expire_pos << "," << last_committed.expire_pos << "), " + << "(wrote.trimmed_pos/last_committed.trimmed_pos=" + << wrote.trimmed_pos << "," << last_committed.trimmed_pos << ")" + << dendl; + ceph_abort(); + } else { + last_committed = wrote; + } if (oncommit) { oncommit->complete(r); } |