From 2483a486b85621cb7a1ef19eeeac4dec7d997deb Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 22 Feb 2021 19:36:54 +0800 Subject: [PATCH] crimson/common: let the first id to be 1 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 --- src/crimson/common/operation.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crimson/common/operation.h b/src/crimson/common/operation.h index 1dbc635f78e..e086bf95a37 100644 --- a/src/crimson/common/operation.h +++ b/src/crimson/common/operation.h @@ -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 { -- 2.39.5