Skip to content
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

implement shard state persistence and recovery upon restart #32

Closed
raulk opened this issue Jul 5, 2021 · 0 comments · Fixed by #41
Closed

implement shard state persistence and recovery upon restart #32

raulk opened this issue Jul 5, 2021 · 0 comments · Fixed by #41
Assignees
Milestone

Comments

@raulk
Copy link
Member

raulk commented Jul 5, 2021

The DAG store management layer must keep its internal state synchronised with an embedded kv database, injected by the user through the existing ds.Datastore constructor option.

Upon restart, the DAG store must resume its state from the database. On every internal operation, the DAG store must update the shard record in the DB through an upsert.

Data model

  • key => shard key
  • value => JSON doc (for debuggability right now; later to be moved to CBOR doc for efficiency)
    • mount URL
    • path to transient
    • last state
    • error msg

Resumption procedure

Iterate through kv store, and add a shard for every key, populating it with the persisted data.
For active shards, verify that the index exists.
For failed shards, track them as failed and recover the last known error.

Shards are never resumed into Serving state, and their refcount is always 0.

@raulk raulk added this to the v0.1 milestone Jul 5, 2021
@raulk raulk changed the title shard state persistence and recovery upon restart implement shard state persistence and recovery upon restart Jul 5, 2021
@raulk raulk linked a pull request Jul 5, 2021 that will close this issue
@raulk raulk self-assigned this Jul 6, 2021
@raulk raulk closed this as completed in #41 Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant