8000 rfc(indexer): Do not fail query when writing to cache by alanshaw · Pull Request #57 · storacha/RFC · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

rfc(indexer): Do not fail query when writing to cache #57

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions rfc/indexer-do-not-fail-query-when-write-to-cache.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# RFC(Indexer): Do not fail query when writing to cache

## Background

When querying the indexer it may have to fetch data from IPNI because it is not found in local caches. It is then written to local caches to allow subsequent requests to be served faster. Under certain conditions writing to the cache may fail. This could be because of varous reasons - e.g. the network connection is down, OOM due to the cache being full of non-expirable items or downtime due to system upgrades.

## Proposal

In the case when writing to the cache fails, the proposal is to return the fetched data to the client instead of raising an error. At this point, the work to fetch from IPNI has already been done, so allowing the client to proceed instead of failing (and possibly trying again) might actually alleviate pressure on the issue and help ensure service levels are maintained (even if operating in a degraded state).

The following additional tasks are also recommended:

* Ensure the error is logged, so that the issue can be debugged.
* Set up monitoring on caches to ensure the error is not masked and/or report the error to a monitoring service e.g. Sentry.
0