Skip to content

Commit ba69d27

Browse files
committed
fixup! feat(migrations): add backfill for botched epoch_start, balance_start, balance_min
1 parent f120843 commit ba69d27

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

backend/pkg/commons/types/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ type Config struct {
209209
TransferAtOnce int64 `yaml:"transferAtOnce" env:"TRANSFER_AT_ONCE, default=2"` // how much data to transfer in a single transfer
210210
RollingsInParallel int64 `yaml:"rollingsAtOnce" env:"ROLLINGS_AT_ONCE, default=3"` // how many rollings to do at once
211211
RollingPartsInParallel int64 `yaml:"rollingsInParallel" env:"ROLLINGS_IN_PARALLEL, default=3"` // how man parts of a single rolling to do at once
212-
BackfillAtOnce int64 `yaml:"backfillAtOnce" env:"BACKFILL_AT_ONCE, default=64"` // how much data to backfill in a single backfill
212+
BackfillAtOnce int64 `yaml:"backfillAtOnce" env:"BACKFILL_AT_ONCE, default=4"` // how much data to backfill in a single backfill
213213
BackfillInParallel int64 `yaml:"backfillInParallel" env:"BACKFILL_IN_PARALLEL, default=2"` // how many backfills to do at once
214214
} `yaml:"dashboardExporter" env:", prefix=DASHBOARD_EXPORTER_"`
215215
Pprof struct {

backend/pkg/exporter/db/db.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,10 +1301,10 @@ func doGenericBackfill(epochs []BackfillMetadata, backfillType BackfillType, col
13011301
abortCtx, cancel := context.WithTimeout(context.Background(), 3*time.Minute)
13021302
defer cancel()
13031303
ctx := ch.Context(abortCtx, ch.WithSettings(ch.Settings{
1304-
"insert_deduplication_token": epochs[0].BackfillBatchId.String(),
1305-
"insert_deduplicate": true,
1306-
"select_sequential_consistency": 1,
1307-
"use_skip_indexes_if_final": 1, // this is only safe because our index is over a column from the primary key
1304+
"insert_deduplication_token": epochs[0].BackfillBatchId.String(),
1305+
"insert_deduplicate": true,
1306+
"use_skip_indexes_if_final": 1, // this is only safe because our index is over a column from the primary key
1307+
"max_threads": 2,
13081308
}))
13091309

13101310
var epoch_timestamp []time.Time
@@ -1362,7 +1362,10 @@ func BackfillMissingMissedRewards(epochs []BackfillMetadata) error {
13621362
}
13631363

13641364
func BackfillBotchedEpochStart(epochs []BackfillMetadata) error {
1365-
return doGenericBackfill(epochs, BackfillTypeBotchedEpochStart, nil, nil, BackfillBotchedEpochStartSink)
1365+
return doGenericBackfill(epochs, BackfillTypeBotchedEpochStart,
1366+
[]exp.AliasedExpression{
1367+
goqu.I("balance_end").As("balance_end"),
1368+
}, nil, BackfillBotchedEpochStartSink)
13661369
}
13671370

13681371
func GetIncompleteInsertEpochs() ([]EpochMetadata, error) { // no limit because it should never grow too large

backend/pkg/exporter/modules/dashboard_data_backfills.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ func (d *dashboardData) roiBackfillTask() {
2323
edb.BackfillTypeEBLookup,
2424
edb.BackfillTypeElectraForkEpochEvents,
2525
edb.BackfillTypeMissingMissedRewards,
26+
edb.BackfillTypeBotchedEpochStart,
2627
}
2728
for _, backfillType := range jobs {
2829
// fork for every backfill we have to do

0 commit comments

Comments
 (0)