Admin version check incompatible with Redis backend #362
Open
Description
Describe the problem
The admin version check (Constance's optimistic locking strategy) requires the read of a set of config values immediately after the write of those values to return the newest values. Unfortunately, with an eventually consistent data store like redis, there is no guarantee that that will be the case. Therefore Constance should not perform this check if the backend is set to redis (or should warn the users about potential pitfalls of not disabling this with IGNORE_ADMIN_VERSION_CHECK).
Steps to reproduce
- Set up a redis instance with a read replica
- Set up Constance with several config values and backend pointing to that instance
- Attempt to POST value updates on the admin screen to one of the config fields in rapid succession.
- You will likely get the following error on the admin screen: "The settings have been modified by someone else. Please reload the form and resubmit your changes." This is because the re-read of the admin values happens from the read replica before it's updated and it therefore gets the old version number.
System configuration
- Django version: Constance 2.4
- Python version: 3.5.3
Metadata
Assignees
Labels
No labels