Repository navigation
Conversation
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) { |
Contributor
There was a problem hiding this comment.
New sig, found it in firehose-core :
```
startBlockNum := bstransform.FindNextUnindexed(
ctx,
viper.GetUint64("index-builder-start-block"),
lookupIdxSizes,
indexShortName,
indexStore,
)
return startBlockNum, nil
```
Will need to be bumped for all variants variants too (fireeth, etc)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FindNextUnindexednow returns(uint64, error): aFileExistsorWalkFromerror from the store is propagated instead of silently swallowed. Root cause ofindex-builderrestarting from--index-builder-start-blockon transient S3 errors (index-builder restarts indexing from the start block when the index store has transient errors firehose-core#288).(*BlockIndexer).Addnow returnserror: a failedwriteIndexis no longer just warned-and-skipped (which left permanent index holes).currentIndexis left unchanged on failure so a caller can retry safely.writeIndexadds a backoff between write retry attempts and cancels each attempt's context immediately instead of leaking it until the function returns.