virajjasani commented on a change in pull request #3826:
URL: https://github.com/apache/hbase/pull/3826#discussion_r745029676
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
##########
@@ -3343,6 +3346,55 @@ boolean waitUntilNoRegionsInTransition(final long
timeout)
return offlineServers;
}
+ void deleteNonZkBasedQualifiersForZkBasedAssignment() throws IOException {
+ boolean isZKAssignmentInUse =
+ ConfigUtil.useZKForAssignment(server.getConfiguration()) &&
!server.getConfiguration()
+ .getBoolean("hbase.assignment.usezk.migrating", false);
+ if (isZKAssignmentInUse) {
+ List<Result> results =
MetaTableAccessor.fullScanOfMeta(server.getConnection());
+ List<Delete> redundantCQDeletes = new ArrayList<>();
+ for (Result result : results) {
+ RegionLocations rl = MetaTableAccessor.getRegionLocations(result);
+ if (rl == null) {
+ continue;
+ }
+ HRegionLocation[] locations = rl.getRegionLocations();
+ if (locations == null) {
+ continue;
+ }
+ for (HRegionLocation hrl : locations) {
+ if (hrl == null) {
+ continue;
+ }
+ HRegionInfo regionInfo = hrl.getRegionInfo();
+ if (regionInfo == null) {
+ continue;
+ }
+ int replicaId = regionInfo.getReplicaId();
+ Cell cell = result.getColumnLatestCell(HConstants.CATALOG_FAMILY,
+ RegionStateStore.getServerNameColumn(replicaId));
+ if (cell != null && cell.getValueLength() > 0) {
+ Delete delete =
+ new Delete(cell.getRowArray(), cell.getRowOffset(),
cell.getRowLength());
+ delete.addColumns(HConstants.CATALOG_FAMILY,
HConstants.SERVERNAME_QUALIFIER);
+ redundantCQDeletes.add(delete);
+ }
+ cell = result.getColumnLatestCell(HConstants.CATALOG_FAMILY,
+ RegionStateStore.getStateColumn(replicaId));
+ if (cell != null && cell.getValueLength() > 0) {
+ Delete delete =
+ new Delete(cell.getRowArray(), cell.getRowOffset(),
cell.getRowLength());
+ delete.addColumns(HConstants.CATALOG_FAMILY,
HConstants.STATE_QUALIFIER);
+ redundantCQDeletes.add(delete);
+ }
+ }
+ }
+ if (!redundantCQDeletes.isEmpty()) {
+ MetaTableAccessor.deleteFromMetaTable(server.getConnection(),
redundantCQDeletes);
Review comment:
Done, Thanks
--
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]