Override cache settings during rb-site invocation.

Review Request #12457 — Created July 11, 2022 and submitted

Information

Review Board
release-5.0.x

Reviewers

The change to move from MemcachedCache to PymemcacheCache broke
things when upgrading from a Python 2-based Review Board 3.0.x to Python
3-based 5.0 beta 1. The problem is that various code paths during
django.start() ended up triggering cache operations, and trying to set
up the old (pre-migrated) MemcachedCache would fail due to a missing
module. We migrate this setting during the upgrade process, but we never
got that far.

This change fixes rb-site to override any stored cache settings and just
use the local-memory cache for the duration of the command. This is
guaranteed to work regardless of what modules happen to be installed.

Ran rb-site upgrade on a site where the old environment used the
memcached package, and the new environment used the pymemcache
package.

Summary ID
Override cache settings during rb-site invocation.
The change to move from `MemcachedCache` to `PymemcacheCache` broke things when upgrading from a Python 2-based Review Board 3.0.x to Python 3-based 5.0 beta 1. The problem is that various code paths during `django.start()` ended up triggering cache operations, and trying to set up the old (pre-migrated) `MemcachedCache` would fail due to a missing module. We migrate this setting during the upgrade process, but we never got that far. This change fixes rb-site to override any stored cache settings and just use the local-memory cache for the duration of the command. This is guaranteed to work regardless of what modules happen to be installed. Testing Done: Ran rb-site upgrade on a site where the old environment used the `memcached` package, and the new environment used the `pymemcache` package.
913d015a0040d9898f3a1178b1ea7f74aea80fc8
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-5.0.x (2463ccd)