diff --git a/documentation/sphinx/source/release-notes.rst b/documentation/sphinx/source/release-notes.rst index 03a770fdc5..8838a2d73a 100644 --- a/documentation/sphinx/source/release-notes.rst +++ b/documentation/sphinx/source/release-notes.rst @@ -2,6 +2,16 @@ Release Notes ############# +6.0.19 +====== + +Fixes +----- + +* The ``include`` command in fdbcli would falsly include all machines with IP addresses that + have the included IP address as a prefix (for example ``include 1.0.0.1`` would also include + ``1.0.0.10``) `(PR #1121) `_ + 6.0.18 ====== diff --git a/fdbclient/ManagementAPI.actor.cpp b/fdbclient/ManagementAPI.actor.cpp index 86eb89ac09..66e224d24d 100644 --- a/fdbclient/ManagementAPI.actor.cpp +++ b/fdbclient/ManagementAPI.actor.cpp @@ -1155,8 +1155,17 @@ ACTOR Future includeServers( Database cx, vector servers tr.clear( excludedServersKeys ); includeAll = true; } else if (s.isWholeMachine()) { - // Eliminate both any ip-level exclusion (1.2.3.4) and any port-level exclusions (1.2.3.4:5) - tr.clear( KeyRangeRef( encodeExcludedServersKey(s), encodeExcludedServersKey(s) + char(':'+1) ) ); + // Eliminate both any ip-level exclusion (1.2.3.4) and any + // port-level exclusions (1.2.3.4:5) + // The range ['IP', 'IP;'] was originally deleted. ';' is + // char(':' + 1). This does not work, as other for all + // x between 0 and 9, 'IPx' will also be in this range. + // + // This is why we now make two clears: first only of the ip + // address, the second will delete all ports. + auto addr = encodeExcludedServersKey(s); + tr.clear(singleKeyRange(addr)); + tr.clear(KeyRangeRef(addr + ':', addr + char(':' + 1))); } else { tr.clear( encodeExcludedServersKey(s) ); }