Skip to content

Missing deletion of cache keys / excessive usage of Redis cacheΒ #2392

@DerDreschner

Description

@DerDreschner

Describe the bug
During some unrelated development work, I realized that the bookmarks app use the Redis cache excessively. For my personal instance with 448 items under "All bookmarks" and 348 items in the trash bin, I count 2922 different keys stored in the Redis cache. After deleting the 348 items in the trash bin, there are still 2817 keys left. This looks like unused keys are not being deleted in all cases by the bookmarks app.

List of used keys and command used

Command:

redis-cli -s /var/run/redis/redis-server.sock -a **REDACTED PASSWORD** --scan --pattern "*/bookmarks*" > ./redis.txt

List of used keys:

redis.txt

To Reproduce
Steps to reproduce the behavior:

  1. Install bookmarks app
  2. Configure the Nextcloud instance to use Redis as cache
  3. Import or create a few bookmarks
  4. Check number of keys in Redis used by the bookmarks app
  5. Delete some bookmarks (including trash bin)
  6. Check number of keys in Redis used by the bookmarks app again

Expected behavior
I would expect the cache keys being deleted if not needed anymore.

Desktop (please complete the following information):

  • OS: Linux Mint 22.3
  • Browser: Firefox
  • Version: 149.0

Server (please complete the following information):

  • OS: Debian 13
  • HTTP server: nginx 1.26.3
  • Database: MariaDB 11.8.6
  • PHP version: 8.5.4
  • Nextcloud version: 33.0.1
  • Bookmarks app version: 16.1.3
  • Nextcloud configuration:
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "cloud.dreschner.net"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/cloud.dreschner.net",
        "app.mail.background-sync-interval": 43200,
        "dbtype": "mysql",
        "version": "33.0.1.2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "Europe\/Berlin",
        "installed": true,
        "maintenance": false,
        "debug": false,
        "loglevel": 2,
        "theme": "",
        "dns_pinning": false,
        "updater.release.channel": "stable",
        "default_phone_region": "DE",
        "filelocking.enabled": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "password": "***REMOVED SENSITIVE VALUE***",
            "timeout": 0.5,
            "dbindex": 0
        },
        "mysql.utf8mb4": true,
        "app_install_overwrite": [
            "calendar",
            "checksum",
            "health"
        ],
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "ssl",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "maintenance_window_start": 0
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions