Skip to content

Commit

Permalink
Fix tablet partition crash (#23019)
Browse files Browse the repository at this point in the history
  • Loading branch information
Spikatrix authored Dec 23, 2024
1 parent 6c8808a commit 19207f5
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,13 @@ export const TabletList: FC<DatabaseListProps> = ({ selectedTableUuid, onRefetch
". This might be because the leader master node is down.");
}
});
let hashPartition = tablet.partition
? [...tablet.partition?.matchAll(/hash_split: \[(.*)\]/g)][0][1]
: "";
/* Example conversion: "hash_split: [0x0000, 0xFFFF]" to "[0x0000, 0xFFFF]" */
let partitionRange =
(tablet.partition && [...tablet.partition.matchAll(/\w+:\s*(.*)/g)][0]?.[1]) ||
"N/A";
return {
id: tablet.tablet_id,
range: hashPartition,
range: partitionRange,
leaderNode: leader,
followerNodes: followers.join(", "),
readReplicaNodes: read_replicas.join(", "),
Expand Down

0 comments on commit 19207f5

Please sign in to comment.