Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

we never clear out cache_invalidation_stream #3665

Closed
richvdh opened this issue Aug 8, 2018 · 4 comments · Fixed by #15868
Closed

we never clear out cache_invalidation_stream #3665

richvdh opened this issue Aug 8, 2018 · 4 comments · Fixed by #15868
Assignees
Labels
A-Database DB stuff like queries, migrations, new/remove columns, indexes, unexpected entries in the db A-Disk-Space things which fill up the disk O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Major functionality / product severely impaired, no satisfactory workaround. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@richvdh
Copy link
Member

richvdh commented Aug 8, 2018

This table is used to communicate cache invalidations to the workers. Once they've read them, the data therein is redundant, and we should automatically clear it out

@richvdh
Copy link
Member Author

richvdh commented Aug 8, 2018

As a workaround for this in the meantime, you can clear them out manually from a psql shell:

-- this will delete invalidations older than 24 hours ago

DELETE FROM cache_invalidation_stream 
WHERE stream_id <= (
  SELECT stream_id FROM cache_invalidation_stream 
    WHERE invalidation_ts < (extract(epoch from now())-(24*3600))*1000 
    ORDER BY stream_id DESC 
    LIMIT 1
  );

VACUUM ANALYZE cache_invalidation_stream;

@richvdh richvdh added the A-Disk-Space things which fill up the disk label Aug 8, 2018
@MurzNN
Copy link

MurzNN commented Jul 8, 2019

Confirm issue, on my homeserver cache_invalidation_stream table have 2364467 rows :(
Can I safely clean-up it via proposed workaround sql query?

@reivilibre reivilibre added S-Major Major functionality / product severely impaired, no satisfactory workaround. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience labels May 23, 2023
@reivilibre reivilibre self-assigned this Jun 30, 2023
@richvdh
Copy link
Member Author

richvdh commented Jul 4, 2023

related: #13456

@richvdh
Copy link
Member Author

richvdh commented Jul 4, 2023

also related: #5888

@MadLittleMods MadLittleMods added the A-Database DB stuff like queries, migrations, new/remove columns, indexes, unexpected entries in the db label Jul 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Database DB stuff like queries, migrations, new/remove columns, indexes, unexpected entries in the db A-Disk-Space things which fill up the disk O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Major functionality / product severely impaired, no satisfactory workaround. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
4 participants