Skip to content

Commit

Permalink
feat(remote_command): allow empty writes to be queried/enabled/disabl…
Browse files Browse the repository at this point in the history
…ed by remote command (#2153)

Support querying/enabling/disabling empty writes on one, multiple or all replica servers
by just one remote command conveniently.

For example, after a table is migrated from a cluster A to another cluster B by duplication,
we want to check whether that migration has been finished by decree. However, since
empty writes would increase the decree, it is necessary to use only one command to
disable empty writes on all replica servers of cluster A without need to restart all of them.
  • Loading branch information
empiredan authored Nov 28, 2024
1 parent f8de6da commit 6ece2f3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/replica/replica_stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ METRIC_DEFINE_gauge_int64(server,
"The max size of copied files among all splitting replicas");

DSN_DECLARE_bool(duplication_enabled);
DSN_DECLARE_bool(empty_write_disabled);
DSN_DECLARE_bool(enable_acl);
DSN_DECLARE_bool(encrypt_data_at_rest);
DSN_DECLARE_int32(fd_beacon_interval_seconds);
Expand Down Expand Up @@ -2354,6 +2355,11 @@ void replica_stub::register_ctrl_command()
});
}));

_cmds.emplace_back(::dsn::command_manager::instance().register_bool_command(
FLAGS_empty_write_disabled,
"replica.disable-empty-write",
"whether to disable empty writes"));

#ifdef DSN_ENABLE_GPERF
_cmds.emplace_back(::dsn::command_manager::instance().register_bool_command(
_release_tcmalloc_memory,
Expand Down

0 comments on commit 6ece2f3

Please sign in to comment.