enum meta_function_level
{
// there are 4 ways to modify the meta-server's status:
// 0. DDL operation: create/drop/recall table
// 1. downgrade primary when dectect it is not alive
// 2. accept primary's update-request to kickoff some secondaries
// 3. make balancer proposal, which further trigger 2
// according to these ways, we give meta several active level.
fl_stopped = 100, //we don't take any action to modify the meta's status, even the DDL operations are not responsed
fl_blind = 200, //only DDL operations are responsed, 1 2 3 are just ignored
fl_freezed = 300, //0 1 are responsed, 2 3 ignored
fl_steady = 400, //0 1 2 are responsed, don't do any balancer
fl_lively = 500, //full functional
fl_invalid = 10000
}
update_configuration_on_remote触发条件:
drop_partition
时downgrade_primary_to_inactive
时downgrade_stateless_nodes
时on_update_configuration
时RPC_CM_UPDATE_PARTITION_CONFIGURATION
请求,且level>fl_freezed时,会转调server_state::on_update_configuration
update_configuration_on_meta_server
发出,会在以下时机触发:小于等于fl_stopped
没有直接使用
小于等于fl_blind
当前level低于
fl_blind
时,将会一直pending,直到level满足条件时会执行_meta_svc->get_remote_storage()->set_data
超时时也会执行重试update_configuration_on_remote
更新partition的配置信息update_partition_max_replica_count_on_remote
设置表的最大副本数小于等于fl_freezed
忽略on_update_configuration请求 忽略create app请求 忽略check_all_partitions
小于等于fl_steady
设置为这些时,将清理所有表的proposal队列 on_config_sync时
等于fl_lively
做rebalance