Skip to content
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

The Admin / Performance page ignores the cache duration specified when creating a database #42741

Closed
Tracked by #42718
rafpaf opened this issue May 16, 2024 · 1 comment · Fixed by #42808
Closed
Tracked by #42718
Labels
Administration/Databases Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness .Team/AdminWebapp Admin and Webapp team Type:Bug Product defects

Comments

@rafpaf
Copy link
Contributor

rafpaf commented May 16, 2024

Describe the bug

When you create a database, you're asked to set a cache invalidation policy. But the Admin / Performance page ignores this.

Loom

To Reproduce

In Admin / Databases, create a new database and under advanced options specify a cache duration. Then go to Admin / Performance and look at the database.

Expected behavior: The database's cache invalidation policy in Admin / Performance should be set to Duration, with the specified number of hours.

Actual behavior: The database's cache invalidation policy in Admin / Performance is still "Use default".

Information about your Metabase installation

{
  "browser-info": {
    "language": "en-US",
    "platform": "MacIntel",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
    "vendor": "Google Inc."
  }
}

Severity

P1

@rafpaf rafpaf added Type:Bug Product defects .Needs Triage labels May 16, 2024
@rafpaf rafpaf added this to the 0.50 milestone May 16, 2024
@rafpaf rafpaf added Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness and removed .Needs Triage labels May 16, 2024
@rafpaf
Copy link
Contributor Author

rafpaf commented May 16, 2024

The database creation form stores a duration in metabase_database.cache_ttl. This duration is ignored by Admin / Performance page, which uses the cache_config table.

Invalidation policies that were previously stored in metabase_database are copied into cache_config via a migration. However, we still let users insert data into metabase_database.

Related matters:

  • Cards have a cache_ttl field which is ignored by Admin / Performance.
  • Dead code in the FE: QuestionCacheTTLField, CacheTTLField, PLUGIN_FORM_WIDGETS
  • src/metabase/query_processor/middleware/cache.clj refers in a comment to a query-caching-default-ttl setting, but this is defunct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Administration/Databases Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness .Team/AdminWebapp Admin and Webapp team Type:Bug Product defects
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants