Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,17 @@ void run(PrintStream out, boolean fix) throws IOException, DeserializationExcept
}
// Third component of a region name is just a literal numeric (not a binary-encoded long)
long regionId = Long.parseLong(Bytes.toString(regionNameParts[2]));
RegionInfo correctedRegionInfo = RegionInfoBuilder.newBuilder(wrongRegionInfo)
// HBASE-24500: We cannot use newBuilder(RegionInfo) because it will copy the NAME and
// encodedName from the original RegionInfo instead of re-computing it. Copy all of the
// fields by hand which will force the new RegionInfo to recompute the NAME/encodedName
// fields.
RegionInfo correctedRegionInfo = RegionInfoBuilder.newBuilder(wrongRegionInfo.getTable())
.setRegionId(regionId)
.setStartKey(wrongRegionInfo.getStartKey())
.setEndKey(wrongRegionInfo.getEndKey())
.setReplicaId(0)
.setOffline(wrongRegionInfo.isOffline())
.setSplit(wrongRegionInfo.isSplit())
.build();

String rowkeyEncodedRegionName = HBCKRegionInfo.encodeRegionName(regionName);
Expand Down