config: Use less generic cache key, and not fragmented by wiki
authorTimo Tijhof <krinklemail@gmail.com>
Mon, 1 May 2017 21:51:57 +0000 (14:51 -0700)
committerTimo Tijhof <krinklemail@gmail.com>
Mon, 1 May 2017 22:06:20 +0000 (15:06 -0700)
commitc09c8b4e936d9343e1774afd39f89a38c73e4165
tree5ef6b792f16a0d9c72a46aff8a171ee65379bc03
parent110a21ea18f4189d10f11acdf807e3b235949b4c
config: Use less generic cache key, and not fragmented by wiki

* Use makeGlobalKey instead of makeKey to avoid fragmenting
  the cache by the wiki-specific key space.

* Add "EtcdConfig" and $this->host to the cache key to make
  it less generic and less likely to conflict with unrelated values
  in case multiple instances exist somewhere in the MediaWiki run
  time (or during testing/debugging).

Adding $this->host should be fine given we were already including
the directory within that host. Although I do recognise that we
may want to encourage slow cache rollover instead of instance
cache rollover in case the host name needs to changed. Perhaps
we should have some kind of canonical name for the instance for
the purpose of caching so that directory or host can be changed
without changing the cache key, and thus have cache roll over
normally over the course of 10 seconds, instead of immediately.

On the other hand, deployment will likely already spread things
out a little bit.

In addition, due to the cache being kept indefinitely this means
the old key will stay indefinitely. Perhaps not an issue given
it's just one key, which will clear on restart eventually?

Bug: T156924
Change-Id: I622e6618f2d4171626e4b272bcb11a97a85cb770
includes/config/EtcdConfig.php