Make WordPress Core

Opened 13 years ago

Last modified 3 months 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: 7.1 Priority: normal
Severity: normal Version: 3.8
Component: Cache API Keywords: has-patch has-unit-tests
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 13 years ago.
26402.2.diff (946 bytes) - added by lukecavanagh 9 years ago.
Patch refresh

Download all attachments as: .zip

Change History (14)

@codix
13 years ago

#1 @uglyrobot
12 years ago

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

#2 @wonderboymusic
12 years ago

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

#3 @nacin
12 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
11 years ago

  • Keywords needs-refresh added

#5 @lukecavanagh
9 years ago

@chriscct7

I can work on a patch refresh.

@lukecavanagh
9 years ago

Patch refresh

This ticket was mentioned in PR #9481 on WordPress/wordpress-develop by @abcd95.


10 months ago
#6

  • Keywords needs-refresh removed

#7 @SergeyBiryukov
7 months ago

  • Milestone changed from Future Release to 7.0

#8 @SergeyBiryukov
7 months ago

  • Keywords has-unit-tests added; needs-unit-tests removed

This ticket was mentioned in Slack in #core by juanmaguitar. View the logs.


4 months ago

#10 @juanmaguitar
4 months ago

From today's bug scrub

I'll keep it for now in 7.0 as if the PR is fine it could still be included in the 7.0 release. I'll ping a Core Comitter to have a look at the PR. I'll be happy to test it when the PR has been approved.

@SergeyBiryukov could you have a look at the PR. If the code is fine I can try to test it.

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


3 months ago

#12 @audrasjb
3 months ago

  • Milestone changed from 7.0 to 7.1

As per today's 7.0 pre-RC1 bug scrub:
As the PR still needs testing, let's move the ticket to 7.1.

Note: See TracTickets for help on using tickets.