Skip to:
Content

BuddyPress.org

Opened 14 years ago

Closed 10 years ago

Last modified 10 years ago

#4522 closed defect (bug) (fixed)

group forum index not refreshing when used with a persistant object cache

Reported by: DJPaul Owned by: r-a-y
Priority: normal Milestone:
Component: Forums Version: 1.5.4
Severity: major Keywords:
Cc:

Description

A group forum's index (bbPress 1) is not refreshed when a new topic is posted in that forum when WordPress is using a persistent object cache.

I'm using ​http://wordpress.org/extend/plugins/apc/ as the object cache, though I'm 99% sure I'm seeing the same problem in a production environment which used Memcached.

I've only noticed this when upgrading from 1.5.4 to 1.6.1, but may have missed the problem in the earlier version.

Change History (9)

#2 @DJPaul
14 years ago

Does anyone have an environment to verify this? At work, I ended up disabling caching for bbPress as a workaround.

#3 @DJPaul
14 years ago

  • Milestone 1.6.2 → Future Release

Punting this to Future Release until/if/when someone else can confirm that this problems exists (or doesn't).

#4 @wpdennis
14 years ago

  • Keywords reporter-feedback added
  • Version 1.5.4 → 1.6.1

@DJPaul: I can confirm this in BP 1.6.1. While using ​memcached newly created topics aren't visible in the group forum directory.

Additionally a topic's permalink is wrong after a reply is submitted and the reply isn't visible either. I've reported this issue in a separate ticket: ​#4759.

Which groups have you disabled? bb_topic, bb_post, bb_forum and bb_option?

Edit:
Ended up with that:

wp_cache_add_non_persistent_groups(array('bb_query', 'bb_cache_posts_post_ids', 'bb_forums', 'bb_topics', 'bb_posts', 'bb_forum', 'bb_topic', 'bb_post', 'bb_option', 'bb_option_not_set', 'bb_topic_tag_terms'));
Last edited 14 years ago by wpdennis (previous) (diff)

#5 @DJPaul
14 years ago

  • Keywords reporter-feedback removed
  • Version 1.6.1 → 1.5.4

Setting version back as that holds the earliest known version of the software that the issue exists in (but I suspect this goes all the way back to 1.2 or earlier).

IIRC, my workaround was just to hack something like get_topics() in bbPress and delete all the "try in cache" code first, i.e. letting it pull from the DB each time.

Wondering if this is a bbPress issue or a BuddyPress issue. What do you think? It's been a while since I looked at this.

#6 follow-up: @wpdennis
14 years ago

Setting version back

Yes, you're right. Makes more sense to know the earliest version.

Wondering if this is a bbPress issue

As far as I can tell right now (I've updated the other ticket with an example):

bbPress relies heavily on wp_cache_flush() but wp_cache_flush() doesn't work if the function is_site_admin() exists (aka multisite I guess) with ​APC or ​memcached (same reason in both implementations). So, the cache doesn't get flushed and we see old values.

If I'm right, that's the "only" problem we have.

Is function_exists('is_site_admin') true in your environment?

#7 in reply to: ↑ 6 @DJPaul
14 years ago

Is function_exists('is_site_admin') true in your environment?

Unfortunately, I've changed jobs since I posted this ticket and no longer have access to the environment.

As painful as it is to install the old standalone bbPress, perhaps we should grab a copy of that from BuddyPress 1.6.2, and set it up, and see if we can recreate an issue -- that way we can confirm it's totally separate from WP + BP. If so, we can create a ticket on the bbPress trac.

#8 @r-a-y
10 years ago

  • Milestone Future Release
  • Resolution → wontfix
  • Status new → closed

We no longer support the older legacy forums component.

#9 @r-a-y
10 years ago

  • Owner set to r-a-y
  • Resolution wontfix → fixed

In 11165:

Legacy Forums: Fix persistent caching issue with bbPress v1.2.

For the legacy forums component, we bundle bbPress v1.2, which includes
BackPress. BackPress uses its own version of wp_cache_flush() that
allows for clearing cache groups:
​https://backpress.trac.wordpress.org/browser/trunk/includes/functions.wp-object-cache.php?marks=77,80#L67

bbPress v1 uses this syntax for wp_cache_flush() throughout its codebase:
​https://bbpress.trac.wordpress.org/browser/tags/1.2/bb-includes/functions.bb-posts.php?marks=452-454#L449
​https://bbpress.trac.wordpress.org/browser/tags/1.2/bb-includes/functions.bb-topics.php?marks=218-219,226-228#L213

However, WordPress' version of wp_cache_flush() does not support clearing
cache groups. This causes various cache invalidation issues as bbPress v1
(incorrectly) assumes that those using a persistent object cache plugin
will support cache group clearing.

To workaround this, we intentionally tell WordPress not to use the
following cache groups as persistent - bb_forums, bb_query, bb_post,
and bb_cache_posts_post_ids.

Props wpdennis, r-a-y.

Fixes #4522, #4759.

Note: See TracTickets for help on using tickets.