smengcl commented on code in PR #3981:
URL: https://github.com/apache/ozone/pull/3981#discussion_r1040014929
##########
hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdiff/RocksDBCheckpointDiffer.java:
##########
@@ -739,48 +735,59 @@ private void internalGetSSTDiffList(
// Traversal level/depth indicator for debug print
int level = 1;
while (!currentLevel.isEmpty()) {
- LOG.debug("BFS level: {}. Current level has {} nodes.",
+ LOG.debug("Traversal level: {}. Current level has {} nodes.",
level++, currentLevel.size());
+ if (level >= 1000000) {
+ LOG.error("Graph traversal level exceeded allowed maximum ({}). "
+ + "This could be due to invalid input generating a "
+ + "loop in the traversal path. Same SSTs found so far: {}, "
+ + "different SSTs: {}", level, sameFiles, differentFiles);
+ // Clear output to indicate an error. Expect fall back to full diff
+ sameFiles.clear();
+ differentFiles.clear();
Review Comment:
Good point. done
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]