From 488e20bf55a7c8ac33f80fe2892507aeb1207c9b Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sun, 20 Jul 2025 14:58:48 +0300 Subject: [PATCH] Remove BS_OP_SYNC_STAB_ALL from OSD --- src/osd/osd.cpp | 7 +------ src/osd/osd.h | 2 -- src/osd/osd_primary_subops.cpp | 1 - src/osd/osd_secondary.cpp | 24 ------------------------ 4 files changed, 1 insertion(+), 33 deletions(-) diff --git a/src/osd/osd.cpp b/src/osd/osd.cpp index 23a26c92..367e6ab6 100644 --- a/src/osd/osd.cpp +++ b/src/osd/osd.cpp @@ -196,7 +196,6 @@ void osd_t::parse_config(bool init) etcd_stats_interval = 30; readonly = json_is_true(config["readonly"]); run_primary = !json_is_false(config["run_primary"]); - allow_test_ops = json_is_true(config["allow_test_ops"]); } log_level = config["log_level"].uint64_value(); auto old_no_rebalance = no_rebalance; @@ -470,11 +469,7 @@ void osd_t::exec_op(osd_op_t *cur_op) finish_op(cur_op, -EROFS); return; } - if (cur_op->req.hdr.opcode == OSD_OP_TEST_SYNC_STAB_ALL) - { - exec_sync_stab_all(cur_op); - } - else if (cur_op->req.hdr.opcode == OSD_OP_SHOW_CONFIG) + if (cur_op->req.hdr.opcode == OSD_OP_SHOW_CONFIG) { exec_show_config(cur_op); } diff --git a/src/osd/osd.h b/src/osd/osd.h index 7d439a77..fc189f10 100644 --- a/src/osd/osd.h +++ b/src/osd/osd.h @@ -119,7 +119,6 @@ class osd_t bool disable_tcp = false; // FIXME: Implement client queue depth limit int client_queue_depth = 128; - bool allow_test_ops = false; int print_stats_interval = 3; int slow_log_interval = 10; int immediate_commit = IMMEDIATE_NONE; @@ -319,7 +318,6 @@ class osd_t // secondary ops bool sec_check_pg_lock(osd_num_t primary_osd, const object_id &oid); - void exec_sync_stab_all(osd_op_t *cur_op); void exec_show_config(osd_op_t *cur_op); void exec_secondary(osd_op_t *cur_op); void exec_secondary_real(osd_op_t *cur_op); diff --git a/src/osd/osd_primary_subops.cpp b/src/osd/osd_primary_subops.cpp index 06569e0e..2c7fe5ba 100644 --- a/src/osd/osd_primary_subops.cpp +++ b/src/osd/osd_primary_subops.cpp @@ -290,7 +290,6 @@ static uint64_t bs_op_to_osd_op[] = { OSD_OP_SEC_DELETE, // BS_OP_DELETE = 6 OSD_OP_SEC_LIST, // BS_OP_LIST = 7 OSD_OP_SEC_ROLLBACK, // BS_OP_ROLLBACK = 8 - OSD_OP_TEST_SYNC_STAB_ALL, // BS_OP_SYNC_STAB_ALL = 9 }; void osd_t::handle_primary_bs_subop(osd_op_t *subop) diff --git a/src/osd/osd_secondary.cpp b/src/osd/osd_secondary.cpp index b9825bd4..bdcf3ba6 100644 --- a/src/osd/osd_secondary.cpp +++ b/src/osd/osd_secondary.cpp @@ -378,27 +378,3 @@ void osd_t::exec_show_config(osd_op_t *cur_op) cur_op->iov.push_back(cur_op->buf, cfg_str.size()+1); finish_op(cur_op, cfg_str.size()+1); } - -void osd_t::exec_sync_stab_all(osd_op_t *cur_op) -{ - // Sync and stabilize all objects - // This command is only valid for tests - cur_op->bs_op = new blockstore_op_t(); - if (!allow_test_ops) - { - cur_op->bs_op->retval = -EINVAL; - secondary_op_callback(cur_op); - return; - } - cur_op->bs_op->opcode = BS_OP_SYNC_STAB_ALL; - cur_op->bs_op->callback = [this, cur_op](blockstore_op_t *bs_op) - { - secondary_op_callback(cur_op); - }; -#ifdef OSD_STUB - cur_op->bs_op->retval = 0; - secondary_op_callback(cur_op); -#else - bs->enqueue_op(cur_op->bs_op); -#endif -}