-
Notifications
You must be signed in to change notification settings - Fork 666
[DB-1625] Indexing without sequences (suggestions) #5238
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
Draft
shaan1337
wants to merge
47
commits into
alexey/secondary-indexes
Choose a base branch
from
alexey/secondary-indexes-suggestions
base: alexey/secondary-indexes
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[DB-1625] Indexing without sequences (suggestions) #5238
shaan1337
wants to merge
47
commits into
alexey/secondary-indexes
from
alexey/secondary-indexes-suggestions
Conversation
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
…scribing to a position but the position is not yet available in the stream/log. In that case the subscriptions will go live directly and wait - there are no retries involved
Qodana for .NET3 new problems were found
💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at [email protected]
|
…reading them: * If in-flight records are committed/cleared while reading them, stop where we have reached and return a partial result. * Always read in-flight records before reading database records: * If in-flight records are committed while reading, we can be sure that they will be present in the subsequent query of database records. * After we've read the database records, some of them may overlap with in-flight records: deduplicate the result. * Simplify inclusive/exclusive log position queries * Simplify sorting by RowId: Always sort in ascending order (return negative RowIds for backwards database reads)
…es event by event, not transaction by transaction (Using only the `PreparePosition` means that the checkpoint could move backwards when processing events from an explicit transaction)
…dditional complexity. There were some issues with the implementation: * "" ($all) was being passed as the index name to SubscriptionMessage.PollStream * The position being polled was incorrect (it was using the main index's position instead of the secondary index's position) * Long polls are not suitable for backward index reads - only forward reads * MissedEvents: the lastIndexedPosition is the main index's position, not the secondary index's position
* cosmetic fixes * don't exclude first event when subscribing to the beginning of the index
…n reached (instead of potentially reading an extra page)
- Throw ObjectDisposedException when disposed - Use the prepare/commit positions from resolvedEvent.OriginalPosition - Track the stream index processor's commit time as part of the commit time
- Separate initialization of the last appended record to avoid the need for synchronization. If the last event in the log was a system event, it was also previously filtered out by RecordAppended() - Use the commit position instead of prepare position of events
…tion when reading events This is required as prepares written with explicit transactions will not have an expected version set - the event number is derived from the commit record.
- Clear in-flight records after flushing the appender to make sure that concurrent reads will see the record either in the in-flight records or in the database
The data in the secondary indexes is already committed to a quorum number of nodes, so it might be ok. But it might be risky, as disposal could be happening due to a fatal error. for e.g consider the case where the system ran out of disk space: we are trying to write even more data.
…irectory by default: - Indexes are usually stored on a separate disk so that IOPS are not shared with the DB for better performance - It's better if DuckDB related files (like the write-ahead log, etc.) are stored in its own directory so that the database code doesn't accidentally modify them. (for e.g all .tmp files are deleted on startup)
9b4b036
to
2f85acd
Compare
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.
No description provided.