bharathv commented on a change in pull request #3438:
URL: https://github.com/apache/hbase/pull/3438#discussion_r661697488
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
##########
@@ -2551,19 +2566,44 @@ private int setOfflineInZooKeeper(final RegionState
state, final ServerName dest
* know the version. So in fact we will never assign a system region to a RS
without registering on zk.
*/
public List<ServerName> getExcludedServersForSystemTable() {
+ return getExcludedServersForSystemTable(false);
+ }
+
+ /**
+ * Get a list of servers that this region can not assign to.
+ * For system table, we must assign them to a server with highest version.
+ * We can disable this exclusion using config:
+ * "hbase.min.version.move.system.tables" if checkForMinVersion is true.
+ *
+ * @param checkForMinVersion if true, check for minVersionToMoveSysTables
+ * and decide moving system table regions accordingly.
+ * @return List of Excluded servers for System table regions.
+ */
+ private List<ServerName> getExcludedServersForSystemTable(
+ boolean checkForMinVersion) {
List<Pair<ServerName, String>> serverList = new ArrayList<>();
for (ServerName s : serverManager.getOnlineServersList()) {
serverList.add(new Pair<>(s, server.getRegionServerVersion(s)));
}
if (serverList.isEmpty()) {
- return new ArrayList<>();
+ return Collections.emptyList();
}
- String highestVersion = Collections.max(serverList, new
Comparator<Pair<ServerName, String>>() {
+ String highestVersion = Collections.max(serverList,
+ new Comparator<Pair<ServerName, String>>() {
@Override
public int compare(Pair<ServerName, String> o1, Pair<ServerName, String>
o2) {
return VersionInfo.compareVersion(o1.getSecond(), o2.getSecond());
}
}).getSecond();
+ if (checkForMinVersion) {
+ if
(!DEFAULT_MIN_VERSION_MOVE_SYS_TABLES_CONFIG.equals(minVersionToMoveSysTables))
{
Review comment:
I don't have a strong opinion. If you ask me, I like the following
version but its subjective. I'm fine with whatever you think is good.
```
checkForMinVersion = checkForMinVersion &&
!DEFAULT_MIN_VERSION_MOVE_SYS_TABLES_CONFIG.equals(minVersionToMoveSysTables);
if (checkForMinVersion) {
,,,,
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]