summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVenky Shankar <vshankar@redhat.com>2024-07-16 06:14:54 +0200
committerGitHub <noreply@github.com>2024-07-16 06:14:54 +0200
commitf4ac1f435c2ac1f241eca7df3f105d52bd11d6d9 (patch)
treea6a66ea3eb0dba59306004e5b76a4c35115e1411 /src
parentMerge pull request #58517 from phlogistonjohn/jjm-cephadm-ranked-by-spec (diff)
parentosdc/Journaler: derr log and abort when header update get (possibly) overwrit... (diff)
downloadceph-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.cc16
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);
}