Make WordPress Core

Opened 4 years ago

Last modified 14 months ago

#26402 new defect (bug)

Add option to DB if option is only present in cache when updating option

Reported by: codix Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.8
Component: Cache API Keywords: has-patch needs-unit-tests needs-refresh
Focuses: Cc:


In very rare circumstances some options may not be in DB but in cache. On update if updating DB fails remove from cache and try to add option. This would eventually fix cache inconsistencies if they occur.

Both update_option and update_site_option are affected.

Attachments (2)

patch.diff (1.8 KB) - added by codix 4 years ago.
26402.2.diff (946 bytes) - added by lukecavanagh 14 months ago.
Patch refresh

Download all attachments as: .zip

Change History (7)

4 years ago

#1 @uglyrobot
4 years ago

I agree that these persistent object cache/db inconsistencies are annoying as heck.

#2 @wonderboymusic
4 years ago

  • Keywords has-patch needs-unit-tests added
  • Milestone changed from Awaiting Review to 3.9

#3 @nacin
4 years ago

  • Milestone changed from 3.9 to Future Release

In very rare circumstances some options may not be in DB but in cache.

Knowing under what circumstances this would occur is really the only good way to fix this.

I understand the desire to wp_cache_delete() in these situations, but I am not sure about the desire to re-add. There is a concern that cache is stale, should just work to clear the cache and let it balance itself out later.

This is lacking unit tests to demonstrate the bug and/or fix, so I'm moving it to future release pending additional feedback.

#4 @chriscct7
3 years ago

  • Keywords needs-refresh added

#5 @lukecavanagh
14 months ago


I can work on a patch refresh.

14 months ago

Patch refresh

Note: See TracTickets for help on using tickets.