pg_party icon indicating copy to clipboard operation
pg_party copied to clipboard

detach_partition clears cache, but the model partitions still holds partitions that were detached.

Open tomer-zadara opened this issue 1 year ago • 2 comments

Using rails (7.0.3.1), postgresql 14 DB, pg_party (1.9.0). detach_partition clears cache, but the model partitions still holds partitions that were detached.

tomer-zadara avatar Dec 30 '24 17:12 tomer-zadara

I don't know your exact situation, but my guess is that you have multiple instances of your Rails app?

From the readme:

Note that caching is done in-memory for each process of an application. Attaching / detaching partitions will clear the cache, but only for the process that initiated the request. For multi-process web servers, it is recommended to use a TTL or disable caching entirely.

rkrage avatar Jan 04 '25 19:01 rkrage

It happens in rails test. I guess due to rails test parallelism the caching issues occur. But I tried to disable caching for test environment and still the issue occurred intermittently.

tomer-zadara avatar Jan 05 '25 07:01 tomer-zadara