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

Option to initialize AKD without write ability #149

Closed
afterdusk opened this issue Feb 19, 2022 · 0 comments · Fixed by #150
Closed

Option to initialize AKD without write ability #149

afterdusk opened this issue Feb 19, 2022 · 0 comments · Fixed by #150
Labels
enhancement New feature or request

Comments

@afterdusk
Copy link
Member

Currently, when AKD is initialized, it will fetch the Azks record in storage. If it is unable to find the record, it will attempt to write the root node (and its epoch 0 state) along with the Azks record.

In a distributed deployment with dedicated readers and writers, we do not want the readers to perform this write on startup. Instead, they should fail on being unable to retrieve the Azks record.

@afterdusk afterdusk added the enhancement New feature or request label Feb 19, 2022
slawlor added a commit that referenced this issue Feb 22, 2022
…and when a change in epoch is detected, flush the cache

Additionally add support for a read-only directory which cannot perform "write" operations to the directory

Resolves: #149, #148
slawlor added a commit that referenced this issue Feb 25, 2022
…nd invalidate cache (#150)

* Add the ability to periodically poll for changes to the AZKS record, and when a change in epoch is detected, flush the cache

Additionally add support for a read-only directory which cannot perform "write" operations to the directory

Resolves: #149, #148

* Apply clippy lints and fix test infra (mysql_async version bump)

* rustfmt

* Addressing @afterdark 's comments around cache access and flushing potential races.

Adds a multi-reader, single-flusher protection around cache operations. Additionally, readers need to poll for AZKS changes or the cache will never update the AZKS object as it's now cached forever until a manual flush operation is done.

* Missed clippy's

Co-authored-by: Sean Lawlor <seanlawlor@fb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant