diff --git a/conduit/plugins/importers/algod/algod_importer.go b/conduit/plugins/importers/algod/algod_importer.go index 2c52aaf..97291b7 100644 --- a/conduit/plugins/importers/algod/algod_importer.go +++ b/conduit/plugins/importers/algod/algod_importer.go @@ -144,11 +144,14 @@ func (algodImp *algodImporter) monitorCatchpointCatchup() error { running = stat.Catchpoint != "" switch { case !running: - break + // break out of loop case stat.CatchpointAcquiredBlocks > 0: algodImp.logger.Infof("catchup phase Acquired Blocks: %d / %d", stat.CatchpointAcquiredBlocks, stat.CatchpointTotalBlocks) + // VerifiedKvs are not shown because kv verification appears to be interleaved with account verification case stat.CatchpointVerifiedAccounts > 0: algodImp.logger.Infof("catchup phase Verified Accounts: %d / %d", stat.CatchpointVerifiedAccounts, stat.CatchpointTotalAccounts) + case stat.CatchpointProcessedKvs > 0: + algodImp.logger.Infof("catchup phase Processed KVs: %d / %d", stat.CatchpointProcessedKvs, stat.CatchpointTotalKvs) case stat.CatchpointProcessedAccounts > 0: algodImp.logger.Infof("catchup phase Processed Accounts: %d / %d", stat.CatchpointProcessedAccounts, stat.CatchpointTotalAccounts) default: diff --git a/conduit/plugins/importers/algod/algod_importer_test.go b/conduit/plugins/importers/algod/algod_importer_test.go index 93d645c..a53d346 100644 --- a/conduit/plugins/importers/algod/algod_importer_test.go +++ b/conduit/plugins/importers/algod/algod_importer_test.go @@ -309,9 +309,14 @@ func TestInitCatchup(t *testing.T) { MakePostSyncRoundResponder(http.StatusOK), MakeJsonResponderSeries("/v2/status", []int{http.StatusOK}, []interface{}{ models.NodeStatus{LastRound: 1235}, - models.NodeStatus{Catchpoint: "1236#abcd", CatchpointProcessedAccounts: 1, CatchpointTotalAccounts: 1}, - models.NodeStatus{Catchpoint: "1236#abcd", CatchpointVerifiedAccounts: 1, CatchpointTotalAccounts: 1}, - models.NodeStatus{Catchpoint: "1236#abcd", CatchpointAcquiredBlocks: 1, CatchpointTotalBlocks: 1}, + models.NodeStatus{Catchpoint: "1236#abcd", CatchpointProcessedAccounts: 1, CatchpointTotalAccounts: 10}, + models.NodeStatus{Catchpoint: "1236#abcd", CatchpointProcessedAccounts: 10, CatchpointTotalAccounts: 10}, + models.NodeStatus{Catchpoint: "1236#abcd", CatchpointProcessedKvs: 2, CatchpointTotalKvs: 20, CatchpointProcessedAccounts: 10, CatchpointTotalAccounts: 10}, + models.NodeStatus{Catchpoint: "1236#abcd", CatchpointProcessedKvs: 20, CatchpointTotalKvs: 20, CatchpointProcessedAccounts: 10, CatchpointTotalAccounts: 10}, + models.NodeStatus{Catchpoint: "1236#abcd", CatchpointVerifiedAccounts: 4, CatchpointProcessedKvs: 20, CatchpointTotalKvs: 20, CatchpointProcessedAccounts: 10, CatchpointTotalAccounts: 10}, + models.NodeStatus{Catchpoint: "1236#abcd", CatchpointVerifiedAccounts: 10, CatchpointProcessedKvs: 20, CatchpointTotalKvs: 20, CatchpointProcessedAccounts: 10, CatchpointTotalAccounts: 10}, + models.NodeStatus{Catchpoint: "1236#abcd", CatchpointAcquiredBlocks: 3, CatchpointTotalBlocks: 30, CatchpointVerifiedAccounts: 10, CatchpointProcessedKvs: 20, CatchpointTotalKvs: 20, CatchpointProcessedAccounts: 10, CatchpointTotalAccounts: 10}, + models.NodeStatus{Catchpoint: "1236#abcd", CatchpointAcquiredBlocks: 30, CatchpointTotalBlocks: 30, CatchpointVerifiedAccounts: 10, CatchpointProcessedKvs: 20, CatchpointTotalKvs: 20, CatchpointProcessedAccounts: 10, CatchpointTotalAccounts: 10}, models.NodeStatus{Catchpoint: "1236#abcd"}, models.NodeStatus{LastRound: 1236}, }), @@ -320,9 +325,14 @@ func TestInitCatchup(t *testing.T) { errInit: "received unexpected error (StatusAfterBlock) waiting for node to catchup: did not reach expected round", errGetGen: "", logs: []string{ - "catchup phase Processed Accounts: 1 / 1", - "catchup phase Verified Accounts: 1 / 1", - "catchup phase Acquired Blocks: 1 / 1", + "catchup phase Processed Accounts: 1 / 10", + "catchup phase Processed Accounts: 10 / 10", + "catchup phase Processed KVs: 2 / 20", + "catchup phase Processed KVs: 20 / 20", + "catchup phase Verified Accounts: 4 / 10", + "catchup phase Verified Accounts: 10 / 10", + "catchup phase Acquired Blocks: 3 / 30", + "catchup phase Acquired Blocks: 30 / 30", "catchup phase Verified Blocks", }}, { @@ -336,9 +346,14 @@ func TestInitCatchup(t *testing.T) { MakePostSyncRoundResponder(http.StatusOK), MakeJsonResponderSeries("/v2/status", []int{http.StatusOK}, []interface{}{ models.NodeStatus{LastRound: 1235}, - models.NodeStatus{Catchpoint: "1236#abcd", CatchpointProcessedAccounts: 1, CatchpointTotalAccounts: 1}, - models.NodeStatus{Catchpoint: "1236#abcd", CatchpointVerifiedAccounts: 1, CatchpointTotalAccounts: 1}, - models.NodeStatus{Catchpoint: "1236#abcd", CatchpointAcquiredBlocks: 1, CatchpointTotalBlocks: 1}, + models.NodeStatus{Catchpoint: "1236#abcd", CatchpointProcessedAccounts: 1, CatchpointTotalAccounts: 10}, + models.NodeStatus{Catchpoint: "1236#abcd", CatchpointProcessedAccounts: 10, CatchpointTotalAccounts: 10}, + models.NodeStatus{Catchpoint: "1236#abcd", CatchpointProcessedKvs: 2, CatchpointTotalKvs: 20, CatchpointProcessedAccounts: 10, CatchpointTotalAccounts: 10}, + models.NodeStatus{Catchpoint: "1236#abcd", CatchpointProcessedKvs: 20, CatchpointTotalKvs: 20, CatchpointProcessedAccounts: 10, CatchpointTotalAccounts: 10}, + models.NodeStatus{Catchpoint: "1236#abcd", CatchpointVerifiedAccounts: 4, CatchpointProcessedKvs: 20, CatchpointTotalKvs: 20, CatchpointProcessedAccounts: 10, CatchpointTotalAccounts: 10}, + models.NodeStatus{Catchpoint: "1236#abcd", CatchpointVerifiedAccounts: 10, CatchpointProcessedKvs: 20, CatchpointTotalKvs: 20, CatchpointProcessedAccounts: 10, CatchpointTotalAccounts: 10}, + models.NodeStatus{Catchpoint: "1236#abcd", CatchpointAcquiredBlocks: 3, CatchpointTotalBlocks: 30, CatchpointVerifiedAccounts: 10, CatchpointProcessedKvs: 20, CatchpointTotalKvs: 20, CatchpointProcessedAccounts: 10, CatchpointTotalAccounts: 10}, + models.NodeStatus{Catchpoint: "1236#abcd", CatchpointAcquiredBlocks: 30, CatchpointTotalBlocks: 30, CatchpointVerifiedAccounts: 10, CatchpointProcessedKvs: 20, CatchpointTotalKvs: 20, CatchpointProcessedAccounts: 10, CatchpointTotalAccounts: 10}, models.NodeStatus{Catchpoint: "1236#abcd"}, models.NodeStatus{LastRound: 1237}, // this is the only difference from the previous test }), @@ -347,9 +362,14 @@ func TestInitCatchup(t *testing.T) { errInit: "", errGetGen: "", logs: []string{ - "catchup phase Processed Accounts: 1 / 1", - "catchup phase Verified Accounts: 1 / 1", - "catchup phase Acquired Blocks: 1 / 1", + "catchup phase Processed Accounts: 1 / 10", + "catchup phase Processed Accounts: 10 / 10", + "catchup phase Processed KVs: 2 / 20", + "catchup phase Processed KVs: 20 / 20", + "catchup phase Verified Accounts: 4 / 10", + "catchup phase Verified Accounts: 10 / 10", + "catchup phase Acquired Blocks: 3 / 30", + "catchup phase Acquired Blocks: 30 / 30", "catchup phase Verified Blocks", }}, }