atsign-foundation / at_server

The software implementation of Atsign's core technology
https://docs.atsign.com
BSD 3-Clause "New" or "Revised" License
40 stars 12 forks source link

ttr, caching and cache refresh bugs #1226

Closed gkc closed 1 year ago

gkc commented 1 year ago

Describe the bug

A number of bugs have crept in to the system over time with regards to the 'ttr' metadata

Expected behavior

So to restate

Additional context

We need to think about side-effects of fixing all of this

VJag commented 1 year ago

Agree with the analysis and the suggestions.

A couple of thoughts:

*. ttr of -1 indicates two things

  1. It can be cached
  2. The value that is cached need not be refreshed

So if the value that is going to be cached may probably change(Including public keys) then we should consider a non -1 value or come up with a different mechanism to update the cache.

*. We should probably find ways to optimize the ttr job along the lines of:

  1. Optimal use of connections
  2. A verb to know the keys that have changed from the value that has been cached
  3. Batch lookup of the keys

*. Expose health of ttr job through stats verb

gkc commented 1 year ago

Thanks @VJag

Additionally as per our discussion, we will continue to cache public data whose ttr is null or 0 as we do now, but we will do so with a ttl of 24 hours so the cached copy will 'expire' after 24 hours.

gkc commented 1 year ago

Complete. PR requires review. Dropping SP to zero for next sprint

gkc commented 1 year ago

Closed by https://github.com/atsign-foundation/at_server/releases/tag/c3.0.28c