Skip to content

Commit a4b493f

Browse files
authored
CPP-705 - Deprecate DC-aware multi-DC settings
1 parent b703d72 commit a4b493f

2 files changed

Lines changed: 35 additions & 10 deletions

File tree

cpp-driver/include/cassandra.h

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,15 +1020,20 @@ cass_execution_profile_set_load_balance_round_robin(CassExecProfile* profile);
10201020
* <b>Note:</b> Profile-based load balancing policy is disabled by default;
10211021
* cluster load balancing policy is used when profile does not contain a policy.
10221022
*
1023+
* @deprecated The remote DC settings for DC-aware are not suitable for most
1024+
* scenarios that require DC failover. There is also unhandled gap between
1025+
* replication factor number of nodes failing and the full cluster failing. Only
1026+
* the remote DC settings are being deprecated.
1027+
*
10231028
* @public @memberof CassExecProfile
10241029
*
10251030
* @param[in] profile
10261031
* @param[in] local_dc The primary data center to try first
10271032
* @param[in] used_hosts_per_remote_dc The number of hosts used in each remote
1028-
* DC if no hosts are available in the local dc
1033+
* DC if no hosts are available in the local dc (<b>deprecated</b>)
10291034
* @param[in] allow_remote_dcs_for_local_cl Allows remote hosts to be used if no
10301035
* local dc hosts are available and the consistency level is LOCAL_ONE or
1031-
* LOCAL_QUORUM
1036+
* LOCAL_QUORUM (<b>deprecated</b>)
10321037
* @return CASS_OK if successful, otherwise an error occurred.
10331038
*
10341039
* @see cass_cluster_set_load_balance_dc_aware()
@@ -1043,13 +1048,18 @@ cass_execution_profile_set_load_balance_dc_aware(CassExecProfile* profile,
10431048
* Same as cass_execution_profile_set_load_balance_dc_aware(), but with lengths
10441049
* for string parameters.
10451050
*
1051+
* @deprecated The remote DC settings for DC-aware are not suitable for most
1052+
* scenarios that require DC failover. There is also unhandled gap between
1053+
* replication factor number of nodes failing and the full cluster failing. Only
1054+
* the remote DC settings are being deprecated.
1055+
*
10461056
* @public @memberof CassExecProfile
10471057
*
10481058
* @param[in] profile
10491059
* @param[in] local_dc
10501060
* @param[in] local_dc_length
1051-
* @param[in] used_hosts_per_remote_dc
1052-
* @param[in] allow_remote_dcs_for_local_cl
1061+
* @param[in] used_hosts_per_remote_dc (<b>deprecated</b>)
1062+
* @param[in] allow_remote_dcs_for_local_cl (<b>deprecated</b>)
10531063
* @return same as cass_execution_profile_set_load_balance_dc_aware()
10541064
*
10551065
* @see cass_execution_profile_set_load_balance_dc_aware()
@@ -2073,14 +2083,20 @@ cass_cluster_set_load_balance_round_robin(CassCluster* cluster);
20732083
* query plans. If relying on this mechanism, be sure to use only contact
20742084
* points from the local DC.
20752085
*
2086+
* @deprecated The remote DC settings for DC-aware are not suitable for most
2087+
* scenarios that require DC failover. There is also unhandled gap between
2088+
* replication factor number of nodes failing and the full cluster failing. Only
2089+
* the remote DC settings are being deprecated.
2090+
*
20762091
* @public @memberof CassCluster
20772092
*
20782093
* @param[in] cluster
20792094
* @param[in] local_dc The primary data center to try first
2080-
* @param[in] used_hosts_per_remote_dc The number of hosts used in each remote DC if no hosts
2081-
* are available in the local dc
2082-
* @param[in] allow_remote_dcs_for_local_cl Allows remote hosts to be used if no local dc hosts
2083-
* are available and the consistency level is LOCAL_ONE or LOCAL_QUORUM
2095+
* @param[in] used_hosts_per_remote_dc The number of hosts used in each remote
2096+
* DC if no hosts are available in the local dc (<b>deprecated</b>)
2097+
* @param[in] allow_remote_dcs_for_local_cl Allows remote hosts to be used if no
2098+
* local dc hosts are available and the consistency level is LOCAL_ONE or
2099+
* LOCAL_QUORUM (<b>deprecated</b>)
20842100
* @return CASS_OK if successful, otherwise an error occurred
20852101
*/
20862102
CASS_EXPORT CassError
@@ -2094,13 +2110,18 @@ cass_cluster_set_load_balance_dc_aware(CassCluster* cluster,
20942110
* Same as cass_cluster_set_load_balance_dc_aware(), but with lengths for string
20952111
* parameters.
20962112
*
2113+
* @deprecated The remote DC settings for DC-aware are not suitable for most
2114+
* scenarios that require DC failover. There is also unhandled gap between
2115+
* replication factor number of nodes failing and the full cluster failing. Only
2116+
* the remote DC settings are being deprecated.
2117+
*
20972118
* @public @memberof CassCluster
20982119
*
20992120
* @param[in] cluster
21002121
* @param[in] local_dc
21012122
* @param[in] local_dc_length
2102-
* @param[in] used_hosts_per_remote_dc
2103-
* @param[in] allow_remote_dcs_for_local_cl
2123+
* @param[in] used_hosts_per_remote_dc (<b>deprecated</b>)
2124+
* @param[in] allow_remote_dcs_for_local_cl (<b>deprecated</b>)
21042125
* @return same as cass_cluster_set_load_balance_dc_aware()
21052126
*
21062127
* @see cass_cluster_set_load_balance_dc_aware()

cpp-driver/src/dc_aware_policy.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ DCAwarePolicy::DCAwarePolicy(const String& local_dc,
3333
, local_dc_live_hosts_(new HostVec())
3434
, index_(0) {
3535
uv_rwlock_init(&available_rwlock_);
36+
if (used_hosts_per_remote_dc_ > 0 || !skip_remote_dcs_for_local_cl) {
37+
LOG_WARN("Remote multi-dc settings have been deprecated and will be removed"
38+
" in the next major release");
39+
}
3640
}
3741

3842
DCAwarePolicy::~DCAwarePolicy() {

0 commit comments

Comments
 (0)