Repository navigation
Conversation
Concurrent upserts can store one (symbol, filename) pair twice. Six identical cold runs of a build of `main` ended with `symbol_filename` row counts up to 99 apart. `insert_batch_and_mark()` runs a batch's functions and types inserts with `tokio::join!`, and both end in `SymbolFilenameStore::insert_batch()`. Several inserters also run at once. When two `merge_insert`s of the same new pair open the table at the same version, both miss and both insert. Serialize `insert_batch()` with a process-global async mutex, held across `open_table` and every chunk's `merge_insert`: the pattern `content.rs` uses for its shards. Every `symbol_filename` upsert in a process now waits for the one before it; the cost to a cold index is not measured. The mutex is a static rather than a field so that stores of different `DatabaseManager`s opened on one database also wait on each other. The new test stores every pair twice without the lock (5,120 rows for 2,560 pairs) and once with it. It runs two `insert_batch()` calls concurrently with the same 64 new pairs, for 40 rounds with fresh pairs each round.
This branch has not been deployed
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.
Concurrent upserts can store one (symbol, filename) pair twice. Six identical cold runs of a build of
mainended withsymbol_filenamerow counts up to 99 apart.insert_batch_and_mark()runs a batch's functions and types inserts withtokio::join!, and both end inSymbolFilenameStore::insert_batch(). Several inserters also run at once. When twomerge_inserts of the same new pair open the table at the same version, both miss and both insert.Serialize
insert_batch()with a process-global async mutex, held acrossopen_tableand every chunk'smerge_insert: the patterncontent.rsuses for its shards. Everysymbol_filenameupsert in a process now waits for the one before it; the cost to a cold index is not measured. The mutex is a static rather than a field so that stores of differentDatabaseManagers opened on one database also wait on each other.The new test stores every pair twice without the lock (5,120 rows for 2,560 pairs) and once with it. It runs two
insert_batch()calls concurrently with the same 64 new pairs, for 40 rounds with fresh pairs each round.