Repository navigation
Manage indexing jobs with a queue - #782
Merged
Merged
Conversation
This option was never set.
Generating a commit from a db is the purview of the db itself, so that code should live in the db namespace hierarchy to avoid cyclic dependencies down the line. This should probably be a protocol, but I'm punting on that for now because I don't think defining this particular protocol is necessary to get the index queue defined
The remaining functions in this namespace are the responsibility of the ledger, so they should be under the ledger namespace hierarchy to avoid cyclic dependencies.
Remove most index considerations when updating commits because most of that functionality will be replaced by dedicated code meant to update indexes, but we still have to check if the current index is newer than that of the new commit, and reload the new database with the new index in that case.
dpetran
reviewed
May 28, 2024
| returns a db with an updated :commit." | ||
| [{:keys [alias conn] :as ledger} {:keys [t stats commit] :as db} opts] | ||
| (go-try | ||
| (let [{:keys [did message tag file-data? index-files-ch] :as opts*} |
Contributor
There was a problem hiding this comment.
Does anything actually supply an index-files-ch opt yet? Is that something that server will supply?
Contributor
There was a problem hiding this comment.
Also, a nitpick: index-files-ch may be a slight misnomer if the FileStore isn't being used. Maybe index-node-ch?
Contributor
There was a problem hiding this comment.
fluree/server supplies it, and it is used to distributed the index file notifications across the network.
| (go))) | ||
|
|
||
|
|
||
| TimeTravel |
Contributor
There was a problem hiding this comment.
I'm liking these new protocols a lot. This looks like a nice step towards decomplecting : )
This is kind of a hack to give the test access to the underlying db's stats. I am hesitant to add a top level api/protocol for db stats because different dbs will necessarily have different stats, so they probably won't be interchangeable.
Simple subject crawl doesn't currently work for every type of db we now support. We're disabling this optimization for now, but we'll be able to bring it back in the context of a general query planning/optimization framework.
18 tasks
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.
This patch schedules indexing jobs for new commits with a dropping queue to ensure we are always working on the latest commit. It also separates commit updates to ledger/branch state from index updates to simplify and streamline those updates, and all of these updates and decisions about when/if to make them are executed entirely within an atomic
swap!to branch state to eliminate race conditions.In order to enable atomic updates to index state, new dbs are loaded in the background within an
AsyncDB. To enable interoperability betweenAsyncDBandJsonLdDb, I had to add more protocols for history queries, policy restriction, and time travel.I also added a new indexing protocol for db record types that replaces the standalone indexer records and
iIndexprotocols. With this patch, all index and commit updates to ledger state are atomic and without any locks.There is still a lot of cleanup and reorganization to do, but this patch is the minimal changeset necessary to manage indexing jobs with a queue.