Complete architectural unification by eliminating redundant SyncModuleConfig
structure and extending ChecksumModuleInfo to include all sync decision fields.
This final unification removes architectural duplication and creates a single
comprehensive configuration structure for all cluster sync operations.
Key improvements:
- Eliminated redundant SyncModuleConfig structure entirely
- Extended ChecksumModuleInfo with sync decision fields (sync_command,
load_runtime_command, sync_conflict_counter, sync_delayed_counter)
- Added sync_enabled_modules unordered_set for selective processing
- Simplified loop to iterate through unified modules array
- Reduced architectural complexity while maintaining functionality
- Added #include <unordered_set> header for std::unordered_set support
All sync operations now use consistent data-driven architecture with
enabled_check() pattern for conditional module dependencies.
proxy_debug(PROXY_DEBUG_CLUSTER,5,"Detected peer %s:%d with %s version %llu, epoch %llu, diff_check %u. Own version: %llu, epoch: %llu. Proceeding with remote sync\n",hostname,port,module.name,v->version,v->epoch,v->diff_check,own_version,own_epoch);
proxy_info("Cluster: detected a peer %s:%d with %s version %llu, epoch %llu, diff_check %u. Own version: %llu, epoch: %llu. Proceeding with remote sync\n",hostname,port,module.name,v->version,v->epoch,v->diff_check,own_version,own_epoch);
if(v->diff_check>= diff_threshold){
proxy_debug(PROXY_DEBUG_CLUSTER,5,"Detected peer %s:%d with %s version %llu, epoch %llu, diff_check %u. Own version: %llu, epoch: %llu. Proceeding with remote sync\n",hostname,port,module.module_name,v->version,v->epoch,v->diff_check,own_version,own_epoch);
proxy_info("Cluster: detected a peer %s:%d with %s version %llu, epoch %llu, diff_check %u. Own version: %llu, epoch: %llu. Proceeding with remote sync\n",hostname,port,module.module_name,v->version,v->epoch,v->diff_check,own_version,own_epoch);
proxy_debug(PROXY_DEBUG_CLUSTER,5,"Detected peer %s:%d with %s version %llu, epoch %llu, diff_check %u, checksum %s. Own version: %llu, epoch: %llu, checksum %s. Sync conflict, epoch times are EQUAL, can't determine which server holds the latest config, we won't sync. This message will be repeated every %u checks until %s is executed on candidate master.\n",hostname,port,module.name,v->version,v->epoch,v->diff_check,v->checksum,own_version,own_epoch,own_checksum,(module.diff_threshold*10),module.load_runtime_command);
proxy_error("Cluster: detected a peer %s:%d with %s version %llu, epoch %llu, diff_check %u, checksum %s. Own version: %llu, epoch: %llu, checksum %s. Sync conflict, epoch times are EQUAL, can't determine which server holds the latest config, we won't sync. This message will be repeated every %u checks until %s is executed on candidate master.\n",hostname,port,module.name,v->version,v->epoch,v->diff_check,v->checksum,own_version,own_epoch,own_checksum,(module.diff_threshold*10),module.load_runtime_command);
proxy_debug(PROXY_DEBUG_CLUSTER,5,"Detected peer %s:%d with %s version %llu, epoch %llu, diff_check %u, checksum %s. Own version: %llu, epoch: %llu, checksum %s. Sync conflict, epoch times are EQUAL, can't determine which server holds the latest config, we won't sync. This message will be repeated every %u checks until %s is executed on candidate master.\n",hostname,port,module.module_name,v->version,v->epoch,v->diff_check,v->checksum,own_version,own_epoch,own_checksum,(diff_threshold*10),module.load_runtime_command);
proxy_error("Cluster: detected a peer %s:%d with %s version %llu, epoch %llu, diff_check %u, checksum %s. Own version: %llu, epoch: %llu, checksum %s. Sync conflict, epoch times are EQUAL, can't determine which server holds the latest config, we won't sync. This message will be repeated every %u checks until %s is executed on candidate master.\n",hostname,port,module.module_name,v->version,v->epoch,v->diff_check,v->checksum,own_version,own_epoch,own_checksum,(diff_threshold*10),module.load_runtime_command);
proxy_debug(PROXY_DEBUG_CLUSTER,5,"Detected peer %s:%d with %s version %llu, epoch %llu, diff_check %u. Own version: %llu, epoch: %llu. diff_check is increasing, but version 1 doesn't allow sync. This message will be repeated every %u checks until %s is executed on candidate master.\n",hostname,port,module.name,v->version,v->epoch,v->diff_check,own_version,own_epoch,(module.diff_threshold*10),module.load_runtime_command);
proxy_warning("Cluster: detected a peer %s:%d with %s version %llu, epoch %llu, diff_check %u. Own version: %llu, epoch: %llu. diff_check is increasing, but version 1 doesn't allow sync. This message will be repeated every %u checks until %s is executed on candidate master.\n",hostname,port,module.name,v->version,v->epoch,v->diff_check,own_version,own_epoch,(module.diff_threshold*10),module.load_runtime_command);
proxy_debug(PROXY_DEBUG_CLUSTER,5,"Detected peer %s:%d with %s version %llu, epoch %llu, diff_check %u. Own version: %llu, epoch: %llu. diff_check is increasing, but version 1 doesn't allow sync. This message will be repeated every %u checks until %s is executed on candidate master.\n",hostname,port,module.module_name,v->version,v->epoch,v->diff_check,own_version,own_epoch,(diff_threshold*10),module.load_runtime_command);
proxy_warning("Cluster: detected a peer %s:%d with %s version %llu, epoch %llu, diff_check %u. Own version: %llu, epoch: %llu. diff_check is increasing, but version 1 doesn't allow sync. This message will be repeated every %u checks until %s is executed on candidate master.\n",hostname,port,module.module_name,v->version,v->epoch,v->diff_check,own_version,own_epoch,(diff_threshold*10),module.load_runtime_command);