Make WordPress Core

Opened 10 years ago

Last modified 7 years ago

#26402 new defect (bug)

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

Reported by: codix's profile 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:

Description

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 10 years ago.
26402.2.diff (946 bytes) - added by lukecavanagh 7 years ago.
Patch refresh

Download all attachments as: .zip

Change History (7)

@codix
10 years ago

#1 @uglyrobot
10 years ago

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

#2 @wonderboymusic
10 years ago

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

#3 @nacin
10 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
8 years ago

  • Keywords needs-refresh added

#5 @lukecavanagh
7 years ago

@chriscct7

I can work on a patch refresh.

@lukecavanagh
7 years ago

Patch refresh

Note: See TracTickets for help on using tickets.