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

services/horizon: Add claimable_balances table to state tables to truncate #3100

Merged
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
1 change: 1 addition & 0 deletions services/horizon/internal/db2/history/ingestion.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ func (q *Q) TruncateExpingestStateTables() error {
"accounts",
"accounts_data",
"accounts_signers",
"claimable_balances",
"exp_asset_stats",
"offers",
"trust_lines",
Expand Down
4 changes: 3 additions & 1 deletion services/horizon/internal/expingest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ const (
// - 10: Fixes a bug in meta processing (fees are now processed before
// everything else).
// - 11: Protocol 14: CAP-23 and CAP-33.
CurrentVersion = 11
// - 12: Trigger state rebuild due to `absTime` -> `abs_time` rename
// in ClaimableBalances predicates.
CurrentVersion = 12
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #3086 (comment) I asked @abuiles to not increment ingestion version because this would trigger state rebuild in pubnet for someone upgrading from 1.9.0 (or earlier) to 1.10.0. However, some users are running testnet servers and this would cause trouble for them (having to run trigger-state-rebuild command). To support them, we increment the version here.


// MaxDBConnections is the size of the postgres connection pool dedicated to Horizon ingestion:
// * Ledger ingestion,
Expand Down
2 changes: 1 addition & 1 deletion services/horizon/internal/expingest/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const assetStatsBatchSize = 500
// check them.
// There is a test that checks it, to fix it: update the actual `verifyState`
// method instead of just updating this value!
const stateVerifierExpectedIngestionVersion = 11
const stateVerifierExpectedIngestionVersion = 12

// verifyState is called as a go routine from pipeline post hook every 64
// ledgers. It checks if the state is correct. If another go routine is already
Expand Down