This is a followup of #1194136: Re-organise core cache bins, comment #106.

Problem/Motivation

The only problem left after #1194136: Re-organise core cache bins is that core provides also a non-bin cache table: cache_tags. And that has the same name pattern as the bins. If you manually truncate the DB cache you may accidentally truncate also cache_tags (I did it!).

Proposed resolution

DB cache bins should have a different name pattern than the cache tags table. Keep them as {cache_*} and rename {cache_tags} to {cachetags}. Cache tables naming will be like:

  • cache_bootstrap
  • cache_data
  • ...
  • cache_render
  • cache_toolbar
  • cachetags

And so bins will have their own namespace.

Remaining tasks

Agreement, patch, RTBC, commit.

User interface changes

None.

API changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

claudiu.cristea’s picture

Status: Active » Needs review
FileSize
1.51 KB

Patch.

claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
sun’s picture

Title: DB cache bins name pattern » {cache_tags} conflicts with cache bin database table names
Related issues: +#918538: Decouple cache tags from cache bins

Adjusting issue title, because I first misunderstood what this is about.

This related issue still intends to refactor cache tags into a separate service, which may or may not change its db table.


Instead of changing all cache bin table names, we could also consider to change the table name of cache tags - to match their service names:

Service           Container::camelize()   Database table
----------------- ----------------------- --------------------
cache.default     Cache_Default           {cache_default}
cache_tags        CacheTags               {cachetags}
dawehner’s picture

The proposal by sun would make it 100% clear that the cachetags table is a special snowflake, not a regular cache table.
The length of the tablenames would also be shorter which is nicer to look at.

claudiu.cristea’s picture

Well, I agree the design proposed by @sun. In fact both are doing the job but I went with my approach to have a minimal patch. Now {cache_tags} has more occurrences. Let me get back with a patch shortly.

claudiu.cristea’s picture

FileSize
6.64 KB

While we don't want to provide an update path from {cache_tags} to {cachetags} I think this should be committed before BETA. I don't think I'm allowed to tag, so I'm asking the reviewer to do it.

Patch!

claudiu.cristea’s picture

Issue summary: View changes

Updated also the issue summary.

claudiu.cristea’s picture

Issue summary: View changes
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Cool

Wim Leers’s picture

+1 for doing the simplest thing possible.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed db72be7 and pushed to 8.x. Thanks!

  • alexpott committed db72be7 on 8.x
    Issue #2302843 by claudiu.cristea: {cache_tags} conflicts with cache bin...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.