Skip to content

Commit

Permalink
Fix: index events according to their local row id (#4762)
Browse files Browse the repository at this point in the history
We use this row id as a watermark, and update it after every ingestion
of an event. Previously, we were iterating over things in an undefined
order, and effectively sometimes ingesting events out of order, causing
bad things to happen to the watermark, leading to much FUN.

## Checklist before requesting a review

- [x] If this code contains consensus-breaking changes, I have added the
"consensus-breaking" label. Otherwise, I declare my belief that there
are not consensus-breaking changes, for the following reason:

  > indexing
  • Loading branch information
cronokirby authored Jul 25, 2024
1 parent 145e959 commit 08f3b2b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/util/cometindex/src/indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ GROUP BY
events.type,
blocks.height,
tx_results.tx_hash
ORDER BY
events.rowid ASC
"#,
)
.bind(watermark)
Expand Down

0 comments on commit 08f3b2b

Please sign in to comment.