From aecf846efee19e563f818d321dbff3ae31dcbada Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Fri, 13 Jun 2025 11:05:19 +0100 Subject: [PATCH 1/2] rfc(indexer): do not fail query when writing to cache --- rfc/indexer-do-not-fail-query-when-write-to-cache.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 rfc/indexer-do-not-fail-query-when-write-to-cache.md diff --git a/rfc/indexer-do-not-fail-query-when-write-to-cache.md b/rfc/indexer-do-not-fail-query-when-write-to-cache.md new file mode 100644 index 0000000..3291a81 --- /dev/null +++ b/rfc/indexer-do-not-fail-query-when-write-to-cache.md @@ -0,0 +1,10 @@ +# RFC: Do not fail query when writing to cache + +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. + +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. From 378e50ab431913355eaf47cefe2895e18224a949 Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Fri, 13 Jun 2025 12:42:51 +0100 Subject: [PATCH 2/2] fix: headings --- rfc/indexer-do-not-fail-query-when-write-to-cache.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rfc/indexer-do-not-fail-query-when-write-to-cache.md b/rfc/indexer-do-not-fail-query-when-write-to-cache.md index 3291a81..c674110 100644 --- a/rfc/indexer-do-not-fail-query-when-write-to-cache.md +++ b/rfc/indexer-do-not-fail-query-when-write-to-cache.md @@ -1,7 +1,11 @@ -# RFC: Do not fail query when writing to cache +# 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: