]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
crimson/osd: make osd_op_params::at_version coherent with last log entry 57056/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 23 Apr 2024 14:10:22 +0000 (14:10 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Thu, 2 May 2024 13:29:56 +0000 (13:29 +0000)
commit5e787fda2e6186e3963e29225b4fa0ac145d2c45
treef90b3486b2d97b78076e92d637a402f3fdac22d8
parenteca3d26124cdbe5eff0d2e356417c977a37e115a
crimson/osd: make osd_op_params::at_version coherent with last log entry

Before this commit we were doing something like:

1. initialize `at_version` with PG::projected_last_update`
   **incremented by one**.
2. produce a log entry at such version.
3. increment `at_version` for the sake of a further production
   that may never come.

The problem is `osd_op_params::at_version` is higher by one
than the last log entry which hurts at later stages of
`osd_op_params` processing (I was hit in the shared EC code
by the assertion in `PG::op_applied`).

This patch changes the algorithm to:

A. initialize `at_version` with PG::projected_last_update`
   **incremented by one**.
B. increment `at_version` for the sake of the very next production.
C. produce a log entry at this version.

Co-authored-by: Matan Breizman <mbreizma@redhat.com>
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/osd/ops_executer.cc
src/crimson/osd/ops_executer.h