From 65392710e3f1b92dfda92b9f0cb700c5fd07abf4 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Wed, 20 Dec 2023 07:54:36 -0600 Subject: [PATCH 1/2] GH-2006 Check for unlinkable blocks while syncing --- tests/nodeos_startup_catchup.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/nodeos_startup_catchup.py b/tests/nodeos_startup_catchup.py index deeae78193..ea4af02747 100755 --- a/tests/nodeos_startup_catchup.py +++ b/tests/nodeos_startup_catchup.py @@ -170,7 +170,10 @@ def waitForNodeStarted(node): waitForBlock(node0, catchupHead+5, timeout=twoRoundsTimeout*2, blockType=BlockType.lib) Print("Restart catchup node") - catchupNode.relaunch() + addSwapFlags = None + if catchup_num % 3 == 0: + addSwapFlags = {"--block-log-retain-blocks": "0", "--delete-all": ""} + catchupNode.relaunch(skipGenesis=False, addSwapFlags=addSwapFlags) waitForNodeStarted(catchupNode) lastCatchupLibNum=lib(catchupNode) @@ -189,6 +192,12 @@ def waitForNodeStarted(node): catchupNode.interruptAndVerifyExitStatus(60) catchupNode.popenProc=None + logFile = Utils.getNodeDataDir(catchupNodeNum) + "/stderr.txt" + f = open(logFile) + contents = f.read() + if contents.count("unlinkable_block_exception") > 3: # a few are fine + errorExit(f"Node{catchupNodeNum} has unlinkable blocks: {logFile}.") + testSuccessful=True finally: From fddc8ede7c5c8976c342662e06f861918dbed5f5 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Wed, 20 Dec 2023 21:41:23 -0600 Subject: [PATCH 2/2] GH-2006 Search for more precise error and provide a bit more tolerance --- tests/nodeos_startup_catchup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/nodeos_startup_catchup.py b/tests/nodeos_startup_catchup.py index ea4af02747..28364fe6c2 100755 --- a/tests/nodeos_startup_catchup.py +++ b/tests/nodeos_startup_catchup.py @@ -195,7 +195,7 @@ def waitForNodeStarted(node): logFile = Utils.getNodeDataDir(catchupNodeNum) + "/stderr.txt" f = open(logFile) contents = f.read() - if contents.count("unlinkable_block_exception") > 3: # a few are fine + if contents.count("3030001 unlinkable_block_exception: Unlinkable block") > 10: # a few are fine errorExit(f"Node{catchupNodeNum} has unlinkable blocks: {logFile}.") testSuccessful=True