Skip to main content

Index rebuild after an upgrade

An upgrade that changes the indexer's data version rebuilds indexed chain data for hours: read its progress, check its provider and spot a stalled rebuild.

After an upgrade that changes the indexer's data version, the indexer rebuilds its dataset while the current dataset keeps serving reads. Act only when the build stops advancing, the RPC provider throttles it, or IndexerBuildFailed fires.

The rebuild re-indexes each EVM network from its configured start block (or Directory deployment block) into a new Ledger Data dataset and switches reads over in one step once caught up. Duration scales with block history and eth_getLogs throughput, so measure it on a non-production copy first. Rolling back past the switch is not self-service (Actions). See Upgrades and migrations.

Symptoms

  • Indexer logs (didx.db.deployment) record Dataset created; it indexes from the chain's start (status=building, new version).
  • Platform admin → Platform networks shows Rebuilding indexed data · <percent>% · block <current> of <target> · started <time>. Reads use the current data until the rebuild catches up. (or without <percent>% before the first block commits) with a progress bar.
  • The Console Submissions tray marks confirmed writes as “Recorded on-chain” (“Recorded on-chain. The platform rebuilds its data, and your lists catch up on their own. Nothing is needed from you.”).
  • Onboarding or invitation calls sending Prefer: dalp-fail-on-indexer-reindexing (when indexerReadinessGate is on, default) return 503 with DALP-12331 (“The indexer is still catching up on this chain”), Retry-After, data.retryAfterSeconds, data.rebuildProgressPercent, data.rebuildStartedAt and data.rebuildSecondsRemaining. Calls without that header are not refused.

Checks

  1. Measure rebuild pace. On Platform admin → Platform networks, read block <current> of <target> twice, 5 minutes apart. The first reading starts at the network's start block share of <target>, not zero. If the gap shrinks, divide the remaining gap by the shrink rate to estimate completion time.

  2. Confirm serving reads stay fresh. Open Organisation settings → Infrastructure → Platform status → Indexing and enable the hidden Stall column alongside Status and Lag. Low Lag confirms the serving lane keeps following the chain during the rebuild.

  3. Check whether the serving lane was refused. If Lag and Stall climb during a rebuild, search indexer logs:

    kubectl -n dalp logs -l 'app.kubernetes.io/component in (indexer,indexer-rebuild)' --tail=300 \
      | grep -E 'Serving lane refused|Writing lane refused|Promotion waits|Dataset promoted'

    Serving lane refused: the serving dataset cannot take this version's writes, so it stays where it is until it can or until promotion means the release changed the data layout in a way the old dataset cannot accept, so serving reads pause until promotion.

  4. Confirm build pods are running when progress flattens. Check the rebuild Deployment pods:

    kubectl -n dalp get pods -l app.kubernetes.io/component=indexer-rebuild

    With the default dapi.indexerDeployment.rebuild.enabled: true (2 replicas), only these pods write the build. Because IndexerBuildFailed does not fire while behind the finalised block, a flat <current> with no alert can still be a stall. Check When to worry.

  5. Check for RPC throttling. A rising dalp_rpc_admission_throttles_total for the slow network means the provider returns 429 and the pool retries on the same endpoint. See RPC upstreams failing over.

Actions

  • Rebuild advancing: Let it drain. Adding indexer replicas adds failover across networks, never faster single-chain rebuild speed.
  • Provider limits pace: The build ignores Console RPC call limits and reads spans up to global.dalpApp.config.indexer.batch.maxBlocks (DIDX_BATCH_MAX_BLOCKS, default 2000), halving on repeated failures and doubling back after three clean commits. Raise it only within your provider's eth_getLogs range limit, or upgrade the provider plan.
  • Stopped at an old block (missing state or pruned history): Point the network's RPC pool at an archive-capable endpoint (What RPC provider does a rebuild need?). Fix it before promotion, because a network whose provider lacks history at the start block does not block promotion.
  • Avoid mid-rebuild rollbacks or upgrades: Deploying a release with a different indexer data version retires the in-progress build (Retiring dataset, reason build for another version), forcing a restart from block zero of the range on the next upgrade.
  • Rolling back after promotion: Older releases refuse to bind a newer serving dataset (Runtime is behind the serving deployment). Do not force it: escalate, or restore the pre-upgrade database backup (Backup and disaster recovery).

When to worry

Signal
What it means
IndexerBuildFailed fires, and dalp_indexer_build_failures_total rose with phase validate
The build reached the finalised block on every network but still trails the serving dataset on one (no commits for 60 seconds, or mismatched block hash). Compare network cards to find the flat <current>.
IndexerBuildFailed fires with phase indexes, and logs show Building the indexes that wait for the dataset to catch up failed; the next check retries
Post-catch-up index creation failed or timed out. Serving data stays live and the next tick retries. Escalate if it repeats.
IndexerBuildFailed fires with phase promote or cleanup, logging Dataset promotion check failed; the next check retries or Drained dataset cleanup failed; the next check retries
Promotion or old-dataset cleanup failed. The next tick retries. Escalate if it repeats.
Indexing stalled: no new block for <age>. on the network card
The serving dataset stopped advancing for 15 minutes while the chain advanced. Follow Ledger indexing stalled.
EVM span chain parked; its siblings continue in indexer logs
One network parked and retries every 5 minutes. Follow Indexer chain parked for failure_tag=repair, or Ledger indexing stalled otherwise.
IndexerSpanRetryLoop fires, or EVM span attempt failed; retrying from the committed watermark repeats with driver_sqlstate
One lane repeats the same SQL error (error_detail shows SQLSTATE and message), stalling the build without firing IndexerBuildFailed. A missing column or table means rebuild pods have not rolled onto the new release yet.
IndexerWritingLaneRefused fires, or Writing lane refused: the dataset cannot take this version's writes, so it stays where it is until it can or until a new build replaces it (host.didx.serving-lane)
The build's layout is incompatible with this release, so rebuild pods will not write or promote it. Escalate: the build needs a new data version. Only builds are refused. Serving datasets without an active build log Writing lane kept on a serving dataset whose layout differs from this version's once and continue.

Verify recovery

The network card on Platform networks clears “Rebuilding indexed data”, indexer logs record Dataset promoted; reads now serve from the rebuild, and IndexerBuildFailed clears.

Escalate

Escalate to your DALP support contact if IndexerBuildFailed repeats, if the block gap stays flat with build pods running and healthy RPC, or after a post-promotion rollback. Include:

  • Source and target release versions.
  • Network name, chain ID, and two timestamped readings of block <current> of <target>.
  • phase values of dalp_indexer_build_failures_total and logs from didx.db.deployment, didx.dataset and host.didx.serving-lane.
  • RPC provider and DIDX_BATCH_MAX_BLOCKS if overridden.

How the rebuild runs

Two lanes run concurrently during a rebuild: the build lane indexes into the new dataset (on the separate indexer-rebuild Deployment when dapi.indexerDeployment.rebuild.enabled is true, or shared with normal indexer pods when false), and the serving lane keeps the active dataset following chain head.

Promotion happens in one atomic switch once every unpaused network reaches its finalised block, catches up to the serving dataset, and has every required read-only index built and valid (while waiting on indexes, logs record Promotion waits for indexes the build dataset does not hold yet).

If the build trails an active serving dataset, DALP pauses the serving lane for up to 30 seconds (Serving dataset frozen for the handover; the build catches up before promotion), switches reads (Dataset promoted; reads now serve from the rebuild), and drops the old dataset at the first check after 1 hour.