pods-framework / pods

The Pods Framework is a Content Development Framework for WordPress - It lets you create and extend content types that can be used for any project. Add fields of various types we've built in, or add your own with custom inputs, you have total control.
https://pods.io/
GNU General Public License v2.0
1.06k stars 266 forks source link

Pods plugin after Version 2.9.11.1 causing infinite cache flushes #7048

Open cmcandrew opened 1 year ago

cmcandrew commented 1 year ago

Description

Upon deployment of either 2.9.12.2 and 2.9.13 the cache is flushed continually and causes an outage across all webservers

Version

2.9.13

Testing Instructions

Pods installation on version 2.9.11.1 updating to both 2.9.12.2 and 2.9.13.

Screenshots / Screencast

Screenshot 2023-03-30 at 09 26 45

Possible Workaround

Site Health Information

`
### wp-core ###

version: 6.1.1
site_language: en_US
user_language: en_US
timezone: +00:00
permalink: /%year%/%monthnum%/%day%/%postname%/
https_status: true
multisite: true
user_registration: false
blog_public: 1
default_comment_status: open
environment_type: production
site_count: 49
network_count: 1
user_count: 1485
dotorg_communication: true

### wp-dropins (5) ###

advanced-cache.php: true
db-error.php: true
db.php: true
object-cache.php: true
sunrise.php: true

### wp-active-theme ###

name: Travel Hub (travel-hub)
version: 1.11.13
author: Blue2 Digital
author_website: http://blue2.co.uk
parent_theme: none
theme_features: core-block-patterns, post-thumbnails, custom-background, permutive, sailthru-horizon, sailthru, widgets-block-editor, sha256, infinite-scroll, automatic-feed-links, menus, html5, post-formats, widgets
theme_path: /srv/src/wp-content/themes/travel-hub
auto_update: Disabled

### wp-plugins-active (28) ###

Admin Columns: version: 4.6.1, author: AdminColumns.com, Auto-updates disabled
Advanced Custom Fields PRO: version: 6.0.7, author: WP Engine, Auto-updates disabled
Blaize: version: 1.28.18, author: Ali Colville, Robert Paul, Frank MacDonald, Auto-updates disabled
Cavalry: version: 1.0.2, author: Cameron Terry, Chris McAndrew, Sander van Dragt, Auto-updates disabled
Classic Editor: version: 1.6.2, author: WordPress Contributors (latest version: 1.6.3), Auto-updates disabled
Contact Form 7: version: 5.7.5.1, author: Takayuki Miyoshi, Auto-updates disabled
Contact Form 7 - Dynamic Text Extension: version: 3.2, author: SevenSpark, AuRise Creative, Auto-updates disabled
Dark Matter: version: 2.3.4, author: Cameron Terry, Auto-updates disabled
GTM4WP: version: 1.16.2, author: Thomas Geiger, Auto-updates disabled
JW Player Plugin: version: 1.6.2-dct-1, author: JW Player, Auto-updates disabled
More Privacy Options: version: 4.6, author: D. Sader, Auto-updates disabled
Newsletter Control: version: 1.18, author: Ali Colville, Auto-updates disabled
Object Cache Pro: version: 1.18.1, author: Rhubarb Group, Auto-updates disabled
oEmbed Plus: version: 1.6, author: Ayesh Karunaratne, Auto-updates disabled
Pods - Custom Content Types and Fields: version: 2.9.11.1, author: Pods Framework Team (latest version: 2.9.13), Auto-updates disabled
PublishPress Future: version: 2.9.2, author: PublishPress, Auto-updates disabled
Redirection: version: 5.3.9, author: John Godley, Auto-updates disabled
Regenerate Thumbnails: version: 3.1.5, author: Alex Mills (Viper007Bond), Auto-updates disabled
Rewrite Rules Inspector: version: 1.3.1, author: Automattic, Daniel Bachhuber, Auto-updates disabled
Stream: version: 3.9.2, author: XWP, Auto-updates disabled
Unpublisher: version: 1.0.4, author: Chris McAndrew, Auto-updates disabled
User Switching: version: 1.7.0, author: John Blackbourn & contributors, Auto-updates disabled
Wordfence Security: version: 7.9.2, author: Wordfence, Auto-updates disabled
WP Offload Media: version: 2.6.2, author: Delicious Brains, Auto-updates disabled
WP Offload Media DCT Config: version: 1.0.3, author: Jason Murray, Auto-updates disabled
Yoast Duplicate Post: version: 4.5, author: Enrico Battocchi & Team Yoast, Auto-updates disabled
Yoast SEO: version: 20.4, author: Team Yoast, Auto-updates disabled

### wp-media ###

image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1690
imagemagick_version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org
imagick_version: 3.7.0
file_uploads: File uploads is turned off
post_max_size: 50M
upload_max_filesize: 50M
max_effective_size: 50 MB
max_file_uploads: 20
imagick_limits: 
    imagick::RESOURCETYPE_AREA: 122 MB
    imagick::RESOURCETYPE_DISK: 1073741824
    imagick::RESOURCETYPE_FILE: 768
    imagick::RESOURCETYPE_MAP: 512 MB
    imagick::RESOURCETYPE_MEMORY: 256 MB
    imagick::RESOURCETYPE_THREAD: 1
imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, ART, ARW, AVI, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DNG, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, FAX, FILE, FITS, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, H, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, JBG, JBIG, JNG, JNX, JPE, JPEG, JPG, JPS, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBP, WMV, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV
gd_version: 2.3.3
gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM
ghostscript_version: 9.50

### wp-server ###

server_architecture: Linux 5.4.0-132-generic x86_64
httpd_software: nginx/1.23.1
php_version: 7.4.32 64bit
php_sapi: fpm-fcgi
max_input_variables: 2000
time_limit: 300
memory_limit: 512M
max_input_time: 60
upload_max_filesize: 50M
php_post_max_size: 50M
curl_version: 7.68.0 OpenSSL/1.1.1f
suhosin: false
imagick_availability: true
pretty_permalinks: true
htaccess_extra_rules: true

### wp-database ###

extension: mysqli
server_version: 10.4.21-MariaDB-1:10.4.21+maria~bionic-log
client_version: mysqlnd 7.4.32
max_allowed_packet: 67108864
max_connections: 1000

### wp-constants ###

WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: /srv/src/wp-content
WP_PLUGIN_DIR: /srv/src/wp-content/plugins
WP_MEMORY_LIMIT: 64M
WP_MAX_MEMORY_LIMIT: 512M
WP_DEBUG: false
WP_DEBUG_DISPLAY: false
WP_DEBUG_LOG: false
SCRIPT_DEBUG: false
WP_CACHE: true
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: production
DB_CHARSET: utf8
DB_COLLATE: undefined

### wp-filesystem ###

wordpress: not writable
wp-content: not writable
uploads: writable
plugins: not writable
themes: not writable
mu-plugins: not writable

### objectcache ###

general-status: Connected
general-dropin: Valid
general-license: Valid
general-env: production
general-multisite: Yes
general-mu: No
general-vcs: No
general-eviction-policy: allkeys-lru
general-compressions: LZF, LZ4, ZSTD
general-basename: redis-cache-pro/redis-cache-pro.php
general-client: RedisCachePro\Clients\PhpRedisCluster
versions-php: 7.4.32 (Outdated)
versions-igbinary: 3.2.6
versions-phpredis: 5.3.7
versions-relay: Not installed
versions-redis: 6.2.1
versions-plugin: 1.18.1
versions-dropin: 1.18.1
statistics-redis-memory: 10 GB of 18 GB
groups-global: [
    "wordfence",
    "wordfence-ls",
    "analytics",
    "blog-details",
    "blog-id-cache",
    "blog-lookup",
    "blog_meta",
    "global-posts",
    "networks",
    "sites",
    "site-details",
    "site-options",
    "site-transient",
    "rss",
    "users",
    "useremail",
    "userlogins",
    "usermeta",
    "user_meta",
    "userslugs",
    "dark-matter",
    "ludicrousdb",
    "batcache",
    "cavalcade"
]
groups-non-persistent: [
    "wordfence",
    "wordfence-ls",
    "counts",
    "plugins",
    "cavalcade-jobs",
    "themes"
]
groups-non-prefetchable: [
    "analytics",
    "userlogins",
    "wc_session_id"
]
config-token: REDACTED
config-connector: RedisCachePro\Connectors\PhpRedisConnector
config-cache: RedisCachePro\ObjectCaches\PhpRedisObjectCache
config-logger: RedisCachePro\Loggers\NullLogger
config-log_levels: warning, notice
config-scheme: tcp
config-host: null
config-port: null
config-database: 0
config-username: null
config-password: REDACTED
config-prefix: null
config-maxttl: null
config-timeout: 1s
config-read_timeout: 1s
config-retry_interval: 300ms
config-retries: 5
config-backoff: smart
config-persistent: false
config-shared: null
config-async_flush: false
config-group_flush: keys
config-network_flush: all
config-cluster: [
    "tcp://REDACTED",
    "tcp://REDACTED",
    "tcp://REDACTED",
    "tcp://REDACTED",
    "tcp://REDACTED",
    "tcp://REDACTED"
]
config-cluster_failover: distribute
config-servers: null
config-replication_strategy: distribute
config-sentinels: null
config-service: null
config-tracer: none
config-serializer: php
config-compression: none
config-global_groups: wordfence, wordfence-ls
config-non_persistent_groups: wordfence, wordfence-ls
config-non_prefetchable_groups: null
config-prefetch: false
config-split_alloptions: true
config-analytics: {
    "enabled": true,
    "persist": true,
    "retention": 7200,
    "footnote": true
}
config-relay: {
    "cache": true,
    "listeners": false,
    "invalidations": true,
    "allowed": null,
    "ignored": [
        "*:analytics:*"
    ]
}
config-tls_options: null
config-updates: true
config-debug: false
config-save_commands: false
environment-WP_REDIS_DISABLED: undefined
environment-OBJECTCACHE_CONFIG: undefined
constants-WP_DEBUG: false
constants-SAVEQUERIES: undefined
constants-WP_REDIS_DIR: undefined
constants-WP_REDIS_DISABLED: false
constants-WP_REDIS_CONFIG: {
    "timeout": 1,
    "read_timeout": 1,
    "retry_interval": 300,
    "log_levels": [
        "warning",
        "notice"
    ],
    "split_alloptions": true,
    "global_groups": [
        "wordfence",
        "wordfence-ls"
    ],
    "non_persistent_groups": [
        "wordfence",
        "wordfence-ls"
    ],
    "debug": false,
    "cluster_failover": "distribute",
    "token": "REDACTED",
    "password": "REDACTED",
    "cluster": [
        "tcp://REDACTED",
        "tcp://REDACTED",
        "tcp://REDACTED",
        "tcp://REDACTED",
        "tcp://REDACTED",
        "tcp://REDACTED"
    ],
    "logger": "RedisCachePro\\Loggers\\NullLogger"
}

### pods ###

pods-server-software: nginx/1.23.1
pods-user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/111.0
pods-session-save-path: /var/lib/php/sessions
pods-session-save-path-exists: Yes
pods-session-save-path-writable: Yes
pods-session-max-lifetime: 1440
pods-opcode-cache-apc: No
pods-opcode-cache-memcached: No
pods-opcode-cache-opcache: Yes
pods-opcode-cache-redis: No
pods-object-cache-apc: No
pods-object-cache-apcu: No
pods-object-cache-memcache: No
pods-object-cache-memcached: No
pods-object-cache-redis: Yes
pods-memory-current-usage: 32.141M
pods-memory-current-usage-real: 16.500M
pods-network-wide: No
pods-install-location: /wp-content/plugins/pods/
pods-developer: No
pods-tableless-mode: No
pods-relationship-table-enabled: Yes
pods-light-mode: No
pods-strict: No
pods-allow-deprecated: Yes
pods-api-cache: Yes
pods-shortcode-allow-evaluate-tags: No
pods-sessions: Disable sessions
pods-can-use-sessions: Yes
pods-relationship-table-status: 337

`

Pods Package

No response

lkraav commented 1 year ago

This was supposedly fixed in 2.9.13 and it is so on my sites.

https://podswp.slack.com/archives/C02SWND14/p1678886519053069

I wonder what might still be going wrong on yours?

cmcandrew commented 1 year ago

v2.9.11.1 - Should a cache flush be initiated just by navigating to Edit Pod; wp-admin/admin.php?page=pods&action=edit&id=5 - no saving being done but cache is flushed

[2023-03-30T13:35:22+00:00] 6425901ac598b - site-id: 23 - cache flushed (site: 23, backtrace: array ( 0 => array ( 'file' => '/var/www/html/wp-content/plugins/pods/classes/PodsView.php', 'line' => 474, 'function' => 'wp_cache_flush', ), 1 => array ( 'file' => '/var/www/html/wp-content/plugins/pods/includes/general.php', 'line' => 2378, 'function' => 'clear', 'class' => 'PodsView', 'type' => '::', ), 2 => array ( 'file' => '/var/www/html/wp-content/plugins/pods/includes/general.php', 'line' => 2429, 'function' => 'pods_view_clear', ), 3 => array ( 'file' => '/var/www/html/wp-content/plugins/pods/classes/PodsAPI.php', 'line' => 10915, 'function' => 'pods_cache_clear', ), 4 => array ( 'file' => '/var/www/html/wp-content/plugins/pods/classes/PodsAPI.php', 'line' => 2457, 'function' => 'cache_flush_pods', 'class' => 'PodsAPI', 'type' => '->', ), ))

cmcandrew commented 1 year ago

Any updates for this?

JoryHogeveen commented 1 year ago

Hi @cmcandrew In reply to your last comment, is the current issue that Pods flushed its cache when you go to the edit page? If so, I don't feel like this is a bug but a measure to make sure you have the correct data when editing.

tillkruss commented 1 year ago

@JoryHogeveen: If you're wiping the entire cache just to get the latest post, that's an antipattern and will hurt the performance of the entire site. Use clean_post_cache() instead.

sc0ttkclark commented 1 year ago

Pods currently flushes various caches in these scenarios:

I'm not seeing a case where it would run on every page load so there may be something else going on here that we'll want to look into.

We could also look into more specific deletes from cache based on keys we know need to be handled but this gets complicated across page loads given the dynamic nature of some of the queries cached and how they are keyed.