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

fix: reject invalid storage cache capacities configs #19016

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

hzxa21
Copy link
Collaborator

@hzxa21 hzxa21 commented Oct 18, 2024

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

  • Remove the max meta cache capacity constrain (4GB) by default.
  • Add a check to ensure only if block_cache_capacity_mb, meta_cache_capacity_mb, shared_buffer_capacity_mb are all overwritten via config and their sum <= non_reserved_memory_bytes * storage_memory_portation (default = 0.3), will these configs be used.
  • Add a check to prevent CN from starting up if resvered_memory_bytes >= total_memory_bytes

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@hzxa21 hzxa21 requested review from fuyufjh, Li0k and MrCroxx October 18, 2024 12:46
@github-actions github-actions bot added the type/fix Bug fix label Oct 18, 2024
Copy link
Member

@fuyufjh fuyufjh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed an unrelated thing: the rustdoc of the fields in CacheConfig and CacheEvictionConfig are missing. These comments are used to generate a human-readable document via ./risedev generate-example-config. Please complete these rustdoc @MrCroxx.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the following changes in this PR:

  • Add #[config_doc(nested)] for storage.cache, storage.data_file_cache, storage.meta_file_cache, storage.cache_refill so that the relevant CacheConfig, FileCacheConfig and CacheRefillConfig show up in docs.md.
  • Add #[config_doc(omitted)] for storage.cache.block_cache_eviction and storage.cach.meta_cache_eviction because I think this is mostly used by us to test the eviction algorithm. @MrCroxx Do you think we need to expose CacheEvictionConfig in docs?
  • Add docs for CacheConfig.

@MrCroxx Can you help to add docs for FileCacheConfig and CacheRefillConfig?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Is it okay that I open another PR than merge to this one, or open another PR separately?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A separate PR would be better, I think.

src/compute/src/memory/config.rs Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Is it okay that I open another PR than merge to this one, or open another PR separately?

Copy link
Contributor

@Li0k Li0k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

src/compute/src/memory/config.rs Show resolved Hide resolved
add warn log

fix typo

fix doc

fix check

fix typo

fix log

fix log

fix docs.md

fix test_storage_memory_config

fmt
@hzxa21 hzxa21 force-pushed the patrick/fix-meta-cache-ratio branch from 14bf20b to 4432929 Compare October 28, 2024 10:31
@hzxa21 hzxa21 added this pull request to the merge queue Oct 29, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 29, 2024
@hzxa21 hzxa21 added this pull request to the merge queue Oct 29, 2024
Merged via the queue into main with commit 4c05b7a Oct 29, 2024
28 of 29 checks passed
@hzxa21 hzxa21 deleted the patrick/fix-meta-cache-ratio branch October 29, 2024 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants