]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/common: let the first id to be 1
authorKefu Chai <kchai@redhat.com>
Mon, 22 Feb 2021 11:36:54 +0000 (19:36 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 24 Feb 2021 07:17:38 +0000 (15:17 +0800)
it'd be simpler if we can use 0 as a sentry for sequencer. 0 would be
id of the last completed operation.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/common/operation.h

index 1dbc635f78e5f6da7415d91ac9836addf4b34fed..e086bf95a374e03131e6306bafb0010d8092d0ed 100644 (file)
@@ -265,7 +265,7 @@ class OperationRegistryT : public OperationRegistryI {
 protected:
   void do_register(Operation *op) final {
     registries[op->get_type()].push_back(*op);
-    op->set_id(op_id_counters[op->get_type()]++);
+    op->set_id(++op_id_counters[op->get_type()]);
   }
 
   bool registries_empty() const final {