Merge pull request #1121 from mpilman/features/fdbcli-include-r6
Fix bug in `include` command
This commit is contained in:
commit
a68dcdf9ed
|
@ -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) <https://github.com/apple/foundationdb/pull/1121>`_
|
||||
|
||||
6.0.18
|
||||
======
|
||||
|
||||
|
|
|
@ -1155,8 +1155,17 @@ ACTOR Future<Void> includeServers( Database cx, vector<AddressExclusion> 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) );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue