-
Notifications
You must be signed in to change notification settings - Fork 186
solana-indexer: advance the finalized watermark from slot statuses #4854
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
base: main
Are you sure you want to change the base?
Changes from all commits
56bbde4
61b1fa3
1bbfdab
be99aa8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -108,6 +108,10 @@ impl Decoder { | |
| .await?; | ||
| continue; | ||
| } | ||
| StreamUpdate::Finalized { slot } => { | ||
| self.persistence.write_finalized_slot(slot).await?; | ||
| continue; | ||
| } | ||
| }; | ||
| self.flush_up_to(&mut pending, slot, &mut flushed_through) | ||
| .await?; | ||
|
|
@@ -164,6 +168,15 @@ impl Decoder { | |
| self.flush_slot(slot, buffer, true).await?; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens if we encounter an error after we already replaced the data in the line above? |
||
| *flushed_through = (*flushed_through).max(Some(slot)); | ||
| } | ||
| // Everything at or below the cutoff is complete even when nothing was | ||
| // buffered: advance the watermark on quiet slots too, so the resume | ||
| // point tracks the stream. | ||
| if cutoff > 0 && *flushed_through < Some(Slot(cutoff)) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how does this check behave if
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we only |
||
| self.persistence | ||
| .write_last_indexed_slot(Slot(cutoff)) | ||
| .await?; | ||
| *flushed_through = Some(Slot(cutoff)); | ||
| } | ||
| Ok(()) | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| -- The chain tip duplicated the last-indexed watermark: quiet slots advance | ||
| -- solana.indexer_state.slot every confirmed slot, so freshness checks read | ||
| -- that row and this table had no reader left. | ||
| DROP TABLE solana.chain_tip; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this variant now being
Finalizedshould theSlotvariant be reamed toConfirmedor whatever commitment level it's actually referring to?