Non blocking algorithm for invalidating and reloading cache in concurrent environment using Redis (with Redisson)

I’m trying to come up with a peace of code that would fetch centralised cache shared across multiple threads/app instances. Callers might come in swarms. The data is a large set, reads during reloading are not desirable as they would likely yield incorrect/incomplete data. Let’s say about once a day (not much more frequent than that) the cache needs to be reloaded, with two triggers: empty cache due to TTL or a business trigger that can not be scheduled ahead of time. Any caller carries enough information to tell if the cache is stale (O(1) check) but not while the cache is being written to – false negatives/positives are possible. Given that, here’s what I managed to come up with: