Skip to content

[BUG]: Metadata cache reset flushes whole redis #16764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hostaway-greg opened this issue Apr 30, 2025 · 1 comment
Open

[BUG]: Metadata cache reset flushes whole redis #16764

hostaway-greg opened this issue Apr 30, 2025 · 1 comment
Assignees
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: high High

Comments

@hostaway-greg
Copy link

Describe the bug
When you use metadata cache with redis adapter, and you call $cache->reset() it sends flushdb to redis server. This clears whole redis database, which can cause a lot of issues.

Expected behavior
Either clear only set keys (store keys internally in Redis adapter) or maybe use prefix mechanism?

Also, documentation should reflect this.

I did not check other adapters.

Details

  • Phalcon version: 5.6.2
  • PHP Version: 8.5.2
  • Operating System: Linux
  • Installation type: compiled from source
  • Server: nginx + fpm

Additional context
Add any other context about the problem here.

@hostaway-greg hostaway-greg added bug A bug report status: unverified Unverified labels Apr 30, 2025
@niden niden self-assigned this May 1, 2025
@niden niden added status: high High 5.0 The issues we want to solve in the 5.0 release and removed status: unverified Unverified labels May 1, 2025
@niden niden added this to Phalcon v5 May 1, 2025
@niden
Copy link
Member

niden commented May 1, 2025

There is some work that I did for v6 that will simplify and help the storage classes. I need to align it with v5 and also fix the clear method. The prefixed keys are not handled the same in all classes so I need to write some more tests to ensure that clear deletes what it is supposed to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: high High
Projects
Status: No status
Development

No branches or pull requests

2 participants