Two seconds of probation is a wait on a key that has just been set, so that the cold cache is not filled with its old value.
The cold cache holds the old name because it was fetched from the warm cache. Mcsqueal kicks that entry out of the warm cache, but it does not broadcast the binary log to the source cluster. Invalidating everything is not an answer, because every update would then require an invalidation.
So every key has a probation timestamp:
- A set marks the key and stores its timestamp.
- A get before that time fetches the value, and the mcrouter gives it to the web application server.
- The value is not stored in the cache while the key is in probation.
Two seconds is a magic number. Facebook saw that most requests are managed within one second, and made it two to be doubly sure.
The trade off is a cache that stays stale if the invalidate does not come through in two seconds. A key with no expiry time is never expired.