Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add processed kvs to catchup logs #168

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion conduit/plugins/importers/algod/algod_importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
44 changes: 32 additions & 12 deletions conduit/plugins/importers/algod/algod_importer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,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},
}),
Expand All @@ -308,9 +313,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",
}},
{
Expand All @@ -324,9 +334,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
}),
Expand All @@ -335,9 +350,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",
}},
}
Expand Down
Loading