Uh oh!
There was an error while loading. Please reload this page.
HBASE-27217 Revisit the DumpReplicationQueues tool - #4810
Conversation
Apache-HBase
commented
Oct 2, 2022
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Oct 2, 2022
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Oct 2, 2022
🎊 +1 overall
This message was automatically generated. |
2005hithlj
commented
Oct 3, 2022
@Apache9 sir. Could you take a look? Thanks. |
Apache9
left a comment
There was a problem hiding this comment.
Left some comments, PTAL.
Thanks @2005hithlj !
| } | ||
| } | ||
| public String dumpReplicationViaTable(Connection connection) throws ReplicationException { |
| if (queueId.isRecovered()) { | ||
| wals = AbstractFSWALProvider | ||
| .getArchivedWALFiles(connection.getConfiguration(), queueId.getSourceServerName().get(), | ||
| URLEncoder.encode(queueId.getSourceServerName().get().toString(), |
| sb.append(" PeerID: " + queueId.getPeerId() + "\n"); | ||
| sb.append(" Recovered: " + queueId.isRecovered() + "\n"); | ||
| if (queueId.getSourceServerName().isPresent()) { | ||
| sb.append(" Dead RegionServers: " + queueId.getSourceServerName().get() + "\n"); |
There was a problem hiding this comment.
Actually here we only record the first region server instead of the all the region servers, so maybe we should change the wording here in the future...
| // long position = queueStorage.getWALPosition(regionserver, queueInfo.getPeerId(), wal); | ||
| // sb.append(" Replication position for " + wal + ": " | ||
| // + (position > 0 ? position : "0" + " (not started or nothing to replicate)") + "\n"); | ||
| long position = -1; |
There was a problem hiding this comment.
I think here we should filter out the wals before the offset?
| position = offset.getOffset(); | ||
| } | ||
| } | ||
| sb.append(" Replication position for " + (walGroup != null ? walGroup + "/" + wal : wal) |
There was a problem hiding this comment.
Notice that, -1 in ReplicationGroupOffset means this file has already been fully replicated.
82a795a to
67a94a6Compare| Set<String> peerIds = | ||
| peers.stream().map((peer) -> peer.getPeerId()).collect(Collectors.toSet()); | ||
| System.out.println(dumpQueues(zkw, peerIds, opts.isHdfs())); | ||
| System.out.println(dumpQueues(zkw, connection, peerIds, opts.isHdfs())); |
| for (ReplicationQueueId queueId : queueIds) { | ||
| List<String> wals = null; | ||
| if (queueId.isRecovered()) { | ||
| wals = AbstractFSWALProvider |
There was a problem hiding this comment.
Just use queueId.getServerWALsBelongTo?
There was a problem hiding this comment.
This method can really solve my problem.
| queueId.getSourceServerName().get().toString()) | ||
| .stream().map(Path::toString).collect(Collectors.toList()); | ||
| } else { | ||
| wals = AbstractFSWALProvider |
There was a problem hiding this comment.
Is this enough to get all the wals for a live region server?
| StringBuilder sb = new StringBuilder(); | ||
| ReplicationQueueStorage queueStorage = | ||
| ReplicationStorageFactory.getReplicationQueueStorage(connection, getConf()); | ||
| Set<ServerName> liveRegionServers = ZKUtil.listChildrenNoWatch(zkw, zkw.getZNodePaths().rsZNode) |
There was a problem hiding this comment.
This could also be done through Admin interface, so we do not need to depend on zk?
| queueId.getServerName().toString()) | ||
| .stream().map(Path::toString).collect(Collectors.toList()); | ||
| } | ||
| Collections.sort(wals); |
There was a problem hiding this comment.
String compare is enough for sorting? Not sure...
Uh oh!
There was an error while loading. Please reload this page.
Apache-HBase
commented
Oct 19, 2022
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Oct 19, 2022
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Oct 19, 2022
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Oct 22, 2022
🎊 +1 overall
This message was automatically generated. |
| } | ||
| } | ||
| private String dumpReplicationViaTable(Connection connection) throws ReplicationException { |
There was a problem hiding this comment.
Checked the code in ZKDump.getReplicationZnodesDump, I do not think this is a direct mapping of the code there?
In ZKDump.getReplicationZnodesDump, first we dump the replication peer data, while here we do not dump it.
And when dumping the replication queue data, we will iterate all rsZNode and print them all, but here we first print all the peers and region servers, and then print all the wal files? Seems a bit strange...
And for dumping hfile refs, we will print hfile refs for each peer in ZKDump.getReplicationZnodesDump, but here we just print them all, without the peer information...
| queueId.getServerName().toString()) | ||
| .stream().map(Path::toString).collect(Collectors.toList()); | ||
| } | ||
| Collections.sort(wals); |
| " Replication position for " + (walGroup != null ? walGroup + "/" + wal : wal) + ": "); | ||
| // Position is -1, which means that the file has already been fully replicated, | ||
| // the logic here is different from the previous version. | ||
| if (position == -1) { |
There was a problem hiding this comment.
Is it possible that we arrive here but position is -1? I think it will be filtered out in the above ReplicationOffsetUtil.shouldReplicate check?
| peerIds.add("1"); | ||
| dumpQueues.setConf(config); | ||
| String dump = dumpQueues.dumpQueues(zkWatcherMock, peerIds, false); | ||
| String dump = dumpQueues.dumpQueues(null, peerIds, false); |
There was a problem hiding this comment.
Parsing null is enough here? We do not need to pass a Connection instance?
67a94a6 to
6d4e7fdCompare6d4e7fd to
56f0241CompareApache9
commented
Nov 1, 2022
I've done a rebase on HBASE-27109, please also rebase here. Thanks. @2005hithlj |
2005hithlj
commented
Nov 2, 2022
@Apache9 OK sir, and I will have a new commit for the comments. |
Apache-HBase
commented
Nov 4, 2022
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Nov 4, 2022
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Nov 4, 2022
🎊 +1 overall
This message was automatically generated. |
Uh oh!
There was an error while loading. Please reload this page.
| } | ||
| } | ||
| // only for test | ||
| if (tmpWals.isEmpty() && !wals.contains(offset.getWal())) { |
Uh oh!
There was an error while loading. Please reload this page.
7d1cbb3 to
c5196d7CompareApache9
commented
Nov 6, 2022
HBASE-27218 has been merged, so you need a rebase here... |
2005hithlj
commented
Nov 7, 2022
OK, sir. |
e90d2c9 to
e9cbb69CompareApache-HBase
commented
Nov 12, 2022
🎊 +1 overall
This message was automatically generated. |
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
https://issues.apache.org/jira/browse/HBASE-27217