Skip to content

Surface index store errors in block_indexer - #86

Open
maoueh wants to merge 1 commit into
developfrom
feature/transform--surface-index-store-errors--firehose-core--288-
Open

maoueh wants to merge 1 commit into
developfrom
feature/transform--surface-index-store-errors--firehose-core--288-

Conversation

@maoueh

@maoueh maoueh commented Oct 9, 2026

Copy link
Copy Markdown
Contributor
  • FindNextUnindexed now returns (uint64, error): a FileExists or WalkFrom error from the store is propagated instead of silently swallowed. Root cause of index-builder restarting from --index-builder-start-block on transient S3 errors (index-builder restarts indexing from the start block when the index store has transient errors firehose-core#288).
  • (*BlockIndexer).Add now returns error: a failed writeIndex is no longer just warned-and-skipped (which left permanent index holes). currentIndex is left unchanged on failure so a caller can retry safely.
  • writeIndex adds a backoff between write retry attempts and cancels each attempt's context immediately instead of leaking it until the function returns.
  • Breaking change, approved: callers in bstream and downstream chains must handle the new error returns.

FindNextUnindexed and BlockIndexer.Add used to swallow dstore errors
(FileExists, WalkFrom, WriteObject), which made index-builder restart
indexing from the start block on transient S3 errors instead of
surfacing the failure. Both now return an error; Add leaves
currentIndex unchanged on a write failure so a retry stays consistent.
writeIndex also backs off between retry attempts and no longer leaks
a context per attempt.
}

func FindNextUnindexed(ctx context.Context, startBlockNum uint64, possibleIndexSizes []uint64, shortName string, store dstore.Store) (next uint64) {
func FindNextUnindexed(ctx context.Context, startBlockNum uint64, possibleIndexSizes []uint64, shortName string, store dstore.Store) (uint64, error) {

@UlysseCorbeil UlysseCorbeil Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

New sig, found it in firehose-core :

			```
			startBlockNum := bstransform.FindNextUnindexed(
				ctx,
				viper.GetUint64("index-builder-start-block"),
				lookupIdxSizes,
				indexShortName,
				indexStore,
			)

			return startBlockNum, nil
		       ```

https://github.com/streamingfast/firehose-core/blob/0807ce22ed8db182655649ae73b2d761bba14857/cmd/apps/index_builder.go#L58-L66

Will need to be bumped for all variants variants too (fireeth, etc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants