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

refactor(storage): Use TableKey struct in the state store interfaces #11943

Merged
merged 6 commits into from
Sep 19, 2023

Conversation

hzxa21
Copy link
Collaborator

@hzxa21 hzxa21 commented Aug 29, 2023

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

What's changed and what's your intention?

Fix #11927

  • Use TableKey struct in the state store interfaces
  • Remove unused codes (src/storage/src/hummock/store/memtable.rs, src/storage/src/write_batch.rs)
  • Move HummockStorage into src/storage/hummock/store/hummock_storage.rs
  • Move LocalHummockStorage into src/storage/hummock/store/local_hummock_storage.rs

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • 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.

@wcy-fdu wcy-fdu self-requested a review August 30, 2023 05:34
@@ -46,15 +51,19 @@ pub enum KeyOp {
/// `MemTable` is a buffer for modify operations without encoding
#[derive(Clone)]
pub struct MemTable {
pub(crate) buffer: BTreeMap<Bytes, KeyOp>,
pub(crate) buffer: BTreeMap<TableKey<Bytes>, KeyOp>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need #[derive(EstimateSize)] for TableKey to make memory statistics more accurate?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is already done in this PR here.

@hzxa21 hzxa21 force-pushed the patrick/memtable-table-key.pr branch 4 times, most recently from 48d7d08 to bd980c2 Compare September 12, 2023 05:49
@codecov
Copy link

codecov bot commented Sep 12, 2023

Codecov Report

Merging #11943 (d6a0d95) into main (eb92f6f) will decrease coverage by 0.02%.
Report is 6 commits behind head on main.
The diff coverage is 83.83%.

@@            Coverage Diff             @@
##             main   #11943      +/-   ##
==========================================
- Coverage   69.73%   69.71%   -0.02%     
==========================================
  Files        1424     1422       -2     
  Lines      236446   236103     -343     
==========================================
- Hits       164881   164601     -280     
+ Misses      71565    71502      -63     
Flag Coverage Δ
rust 69.71% <83.83%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
src/jni_core/src/hummock_iterator.rs 0.00% <ø> (ø)
src/rpc_client/src/meta_client.rs 4.09% <0.00%> (ø)
...storage/hummock_test/src/bin/replay/replay_impl.rs 0.00% <0.00%> (ø)
src/storage/hummock_test/src/failpoint_tests.rs 0.00% <0.00%> (ø)
...age/src/hummock/compactor/shared_buffer_compact.rs 85.71% <ø> (ø)
src/storage/src/hummock/error.rs 22.35% <ø> (-2.65%) ⬇️
src/storage/src/hummock/event_handler/mod.rs 19.64% <ø> (ø)
src/storage/src/hummock/iterator/mod.rs 46.07% <ø> (ø)
src/storage/src/hummock/mod.rs 86.41% <ø> (+2.20%) ⬆️
src/storage/src/monitor/monitored_store.rs 4.49% <0.00%> (-0.09%) ⬇️
... and 23 more

... and 5 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@hzxa21 hzxa21 requested review from Li0k and wenym1 September 12, 2023 09:05
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.

LGTM

src/storage/clippy.toml Show resolved Hide resolved
@hzxa21 hzxa21 force-pushed the patrick/memtable-table-key.pr branch from ba2e73d to 94c59b8 Compare September 18, 2023 08:22
@hzxa21 hzxa21 added this pull request to the merge queue Sep 19, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 19, 2023
@hzxa21 hzxa21 force-pushed the patrick/memtable-table-key.pr branch from 94c59b8 to d6a0d95 Compare September 19, 2023 06:16
@hzxa21 hzxa21 enabled auto-merge September 19, 2023 07:03
@hzxa21 hzxa21 added this pull request to the merge queue Sep 19, 2023
Merged via the queue into main with commit ff50ccb Sep 19, 2023
6 of 7 checks passed
@hzxa21 hzxa21 deleted the patrick/memtable-table-key.pr branch September 19, 2023 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use TableKey struct in memtable instead of Bytes
4 participants