@ -392,8 +392,6 @@ static char * admin_variables_names[]= {
( char * ) " cluster_pgsql_query_rules_diffs_before_sync " ,
( char * ) " cluster_pgsql_servers_diffs_before_sync " ,
( char * ) " cluster_pgsql_users_diffs_before_sync " ,
( char * ) " cluster_pgsql_replication_hostgroups_diffs_before_sync " ,
( char * ) " cluster_pgsql_hostgroup_attributes_diffs_before_sync " ,
( char * ) " cluster_mysql_query_rules_save_to_disk " ,
( char * ) " cluster_mysql_servers_save_to_disk " ,
( char * ) " cluster_mysql_users_save_to_disk " ,
@ -405,8 +403,6 @@ static char * admin_variables_names[]= {
( char * ) " cluster_pgsql_query_rules_save_to_disk " ,
( char * ) " cluster_pgsql_servers_save_to_disk " ,
( char * ) " cluster_pgsql_users_save_to_disk " ,
( char * ) " cluster_pgsql_replication_hostgroups_save_to_disk " ,
( char * ) " cluster_pgsql_hostgroup_attributes_save_to_disk " ,
( char * ) " cluster_mysql_servers_sync_algorithm " ,
( char * ) " checksum_mysql_query_rules " ,
( char * ) " checksum_mysql_servers " ,
@ -2669,8 +2665,6 @@ ProxySQL_Admin::ProxySQL_Admin() :
variables . cluster_pgsql_query_rules_diffs_before_sync = 3 ;
variables . cluster_pgsql_servers_diffs_before_sync = 3 ;
variables . cluster_pgsql_users_diffs_before_sync = 3 ;
variables . cluster_pgsql_replication_hostgroups_diffs_before_sync = 3 ;
variables . cluster_pgsql_hostgroup_attributes_diffs_before_sync = 3 ;
variables . cluster_mysql_servers_sync_algorithm = 1 ;
checksum_variables . checksum_mysql_query_rules = true ;
checksum_variables . checksum_mysql_servers = true ;
@ -2690,8 +2684,6 @@ ProxySQL_Admin::ProxySQL_Admin() :
variables . cluster_pgsql_query_rules_save_to_disk = true ;
variables . cluster_pgsql_servers_save_to_disk = true ;
variables . cluster_pgsql_users_save_to_disk = true ;
variables . cluster_pgsql_replication_hostgroups_save_to_disk = true ;
variables . cluster_pgsql_hostgroup_attributes_save_to_disk = true ;
variables . stats_mysql_connection_pool = 60 ;
variables . stats_mysql_connections = 60 ;
variables . stats_mysql_query_cache = 60 ;
@ -3427,15 +3419,7 @@ char * ProxySQL_Admin::get_variable(char *name) {
sprintf ( intbuf , " %d " , variables . cluster_pgsql_users_diffs_before_sync ) ;
return strdup ( intbuf ) ;
}
if ( ! strcasecmp ( name , " cluster_pgsql_replication_hostgroups_diffs_before_sync " ) ) {
sprintf ( intbuf , " %d " , variables . cluster_pgsql_replication_hostgroups_diffs_before_sync ) ;
return strdup ( intbuf ) ;
}
if ( ! strcasecmp ( name , " cluster_pgsql_hostgroup_attributes_diffs_before_sync " ) ) {
sprintf ( intbuf , " %d " , variables . cluster_pgsql_hostgroup_attributes_diffs_before_sync ) ;
return strdup ( intbuf ) ;
}
if ( ! strcasecmp ( name , " cluster_pgsql_variables_diffs_before_sync " ) ) {
if ( ! strcasecmp ( name , " cluster_pgsql_variables_diffs_before_sync " ) ) {
sprintf ( intbuf , " %d " , variables . cluster_pgsql_variables_diffs_before_sync ) ;
return strdup ( intbuf ) ;
}
@ -3473,12 +3457,6 @@ char * ProxySQL_Admin::get_variable(char *name) {
if ( ! strcasecmp ( name , " cluster_pgsql_users_save_to_disk " ) ) {
return strdup ( ( variables . cluster_pgsql_users_save_to_disk ? " true " : " false " ) ) ;
}
if ( ! strcasecmp ( name , " cluster_pgsql_replication_hostgroups_save_to_disk " ) ) {
return strdup ( ( variables . cluster_pgsql_replication_hostgroups_save_to_disk ? " true " : " false " ) ) ;
}
if ( ! strcasecmp ( name , " cluster_pgsql_hostgroup_attributes_save_to_disk " ) ) {
return strdup ( ( variables . cluster_pgsql_hostgroup_attributes_save_to_disk ? " true " : " false " ) ) ;
}
if ( ! strcasecmp ( name , " cluster_pgsql_variables_save_to_disk " ) ) {
return strdup ( ( variables . cluster_pgsql_variables_save_to_disk ? " true " : " false " ) ) ;
}
@ -4038,37 +4016,7 @@ bool ProxySQL_Admin::set_variable(char *name, char *value, bool lock) { // this
return false ;
}
}
if ( ! strcasecmp ( name , " cluster_pgsql_replication_hostgroups_diffs_before_sync " ) ) {
int intv = atoi ( value ) ;
if ( intv > = 0 & & intv < = 1000 ) {
intv = checksum_variables . checksum_mysql_servers ? intv : 0 ; // Reuse mysql_servers checksum
if ( variables . cluster_pgsql_replication_hostgroups_diffs_before_sync = = 0 & & intv ! = 0 ) {
proxy_info ( " Re-enabled previously disabled 'admin-cluster_pgsql_replication_hostgroups_diffs_before_sync'. Resetting global checksums to force Cluster re-sync. \n " ) ;
GloProxyCluster - > Reset_Global_Checksums ( lock ) ;
}
variables . cluster_pgsql_replication_hostgroups_diffs_before_sync = intv ;
GloProxyCluster - > cluster_pgsql_replication_hostgroups_diffs_before_sync = intv ;
return true ;
} else {
return false ;
}
}
if ( ! strcasecmp ( name , " cluster_pgsql_hostgroup_attributes_diffs_before_sync " ) ) {
int intv = atoi ( value ) ;
if ( intv > = 0 & & intv < = 1000 ) {
intv = checksum_variables . checksum_mysql_servers ? intv : 0 ; // Reuse mysql_servers checksum
if ( variables . cluster_pgsql_hostgroup_attributes_diffs_before_sync = = 0 & & intv ! = 0 ) {
proxy_info ( " Re-enabled previously disabled 'admin-cluster_pgsql_hostgroup_attributes_diffs_before_sync'. Resetting global checksums to force Cluster re-sync. \n " ) ;
GloProxyCluster - > Reset_Global_Checksums ( lock ) ;
}
variables . cluster_pgsql_hostgroup_attributes_diffs_before_sync = intv ;
GloProxyCluster - > cluster_pgsql_hostgroup_attributes_diffs_before_sync = intv ;
return true ;
} else {
return false ;
}
}
if ( ! strcasecmp ( name , " cluster_pgsql_variables_diffs_before_sync " ) ) {
if ( ! strcasecmp ( name , " cluster_pgsql_variables_diffs_before_sync " ) ) {
int intv = atoi ( value ) ;
if ( intv > = 0 & & intv < = 1000 ) {
intv = checksum_variables . checksum_pgsql_variables ? intv : 0 ;
@ -4324,35 +4272,7 @@ bool ProxySQL_Admin::set_variable(char *name, char *value, bool lock) { // this
}
return rt ;
}
if ( ! strcasecmp ( name , " cluster_pgsql_replication_hostgroups_save_to_disk " ) ) {
bool rt = false ;
if ( strcasecmp ( value , " true " ) = = 0 | | strcasecmp ( value , " 1 " ) = = 0 ) {
variables . cluster_pgsql_replication_hostgroups_save_to_disk = true ;
rt = __sync_lock_test_and_set ( & GloProxyCluster - > cluster_pgsql_replication_hostgroups_save_to_disk , true ) ;
return true ;
}
if ( strcasecmp ( value , " false " ) = = 0 | | strcasecmp ( value , " 0 " ) = = 0 ) {
variables . cluster_pgsql_replication_hostgroups_save_to_disk = false ;
rt = __sync_lock_test_and_set ( & GloProxyCluster - > cluster_pgsql_replication_hostgroups_save_to_disk , false ) ;
return true ;
}
return rt ;
}
if ( ! strcasecmp ( name , " cluster_pgsql_hostgroup_attributes_save_to_disk " ) ) {
bool rt = false ;
if ( strcasecmp ( value , " true " ) = = 0 | | strcasecmp ( value , " 1 " ) = = 0 ) {
variables . cluster_pgsql_hostgroup_attributes_save_to_disk = true ;
rt = __sync_lock_test_and_set ( & GloProxyCluster - > cluster_pgsql_hostgroup_attributes_save_to_disk , true ) ;
return true ;
}
if ( strcasecmp ( value , " false " ) = = 0 | | strcasecmp ( value , " 0 " ) = = 0 ) {
variables . cluster_pgsql_hostgroup_attributes_save_to_disk = false ;
rt = __sync_lock_test_and_set ( & GloProxyCluster - > cluster_pgsql_hostgroup_attributes_save_to_disk , false ) ;
return true ;
}
return rt ;
}
if ( ! strcasecmp ( name , " cluster_pgsql_variables_save_to_disk " ) ) {
if ( ! strcasecmp ( name , " cluster_pgsql_variables_save_to_disk " ) ) {
bool rt = false ;
if ( strcasecmp ( value , " true " ) = = 0 | | strcasecmp ( value , " 1 " ) = = 0 ) {
variables . cluster_pgsql_variables_save_to_disk = true ;
@ -4410,10 +4330,6 @@ bool ProxySQL_Admin::set_variable(char *name, char *value, bool lock) { // this
GloProxyCluster - > cluster_mysql_users_diffs_before_sync = 0 ;
variables . cluster_pgsql_users_diffs_before_sync = 0 ;
GloProxyCluster - > cluster_pgsql_users_diffs_before_sync = 0 ;
variables . cluster_pgsql_replication_hostgroups_diffs_before_sync = 0 ;
GloProxyCluster - > cluster_pgsql_replication_hostgroups_diffs_before_sync = 0 ;
variables . cluster_pgsql_hostgroup_attributes_diffs_before_sync = 0 ;
GloProxyCluster - > cluster_pgsql_hostgroup_attributes_diffs_before_sync = 0 ;
proxy_warning ( " Disabling deprecated 'admin-checksum_pgsql_users', setting 'admin-cluster_pgsql_users_diffs_before_sync=0' \n " ) ;
return true ;
}