-
Notifications
You must be signed in to change notification settings - Fork 19
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
Differentiate "not found" from cache hit vs actual not found #115
Comments
@ronaldtse we had the behavior when a flavor cache was wiped if the flavor gem's version was changed. @opoudjis initiated moving from the algorithm depended on a gem version. Let's ask Nick's opinion. |
I'm having trouble remembering and understanding the distinction, and I do not have the free time to explore this. The requirement is simple: if the output now is going to be different from what it used to be, we need to refetch the record. The problem is, the schema changes some of the time, and the gem is changing constantly. The gem was changing so frequently, that we decided not to use gem updates as the criterion for flushing the cache, but schema updates instead. Andrej, I cannot make the call of when to do a flush, because that depends on the content being exported, which is your area. I think switching to schema update or minor relaton version change as the trigger is the right balance to make: gem updates were simply too frequent. That said, it would also make sense never to store a Not Found record in the cache, so that it always tries to refind such a version. Not just when relaton is updated: always. Because the Not Found could well just be the site being down that day. And if the not found is happening all the time, then there is an issue that relaton needs to resolve; it can't just be ignored by the user. (I vaguely think we used not to store Not Found in the cache, or at least ignore it. But it's your code, you tell me.) |
@andrew2net any updates here? Thanks! |
The cases when Not Found is not stored in cache are:
The Not Found is stored in cases:
Of course, we can stop storing Not Found in a cache, but it will slow down fetching documents if the Not Found reference is fetched again. It may be not a big problem when the relaton is used locally. The Not Found was supposed to be useful in API mode as a cloud cache. I hope we will implement it finally. So let's disable the Not Found for local use. As for triggering a cache flushing, it seems that both, schema and gem version based algorithms are not good enough. Maybe we can create cache version constants in each flavor gem and update the constants manually in case the cache should be flushed. @ronaldtse @opoudjis any thoughts? |
... But someone has to know when to set that constant manually and when not to. That someone would have to be be you. I don't like it though, it's one more dependency that can go wrong; and it is better to flush too often than not to flush often enough. |
I don't like it too. So let's flush the cache more often triggering it by gem version changing. |
Fixed in relaton and relaton-cli v1.16.1. For ignore cache use $ relaton fetch --no-cache "NIST CSWP 6" |
Sometimes the cache of an entry "not found" can be found in reality, but the cache was stuck to an old result of "not found".
e.g.
From @andrew2net:
Users will never be able to figure this out.
When the Relaton-xxx gem is updated, should the cache be wiped? At least the "not found" ones?
This information needs to be described in the output:
In any case, we must differentiate a "cache hit not found" vs the "actual not found", at the library level. And provide an "ignore cache" option.
From relaton/relaton-nist#93
The text was updated successfully, but these errors were encountered: