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(cache): fix dedup error of meta-cache #6483

Merged
merged 4 commits into from
Nov 21, 2022

Conversation

Little-Wallace
Copy link
Contributor

@Little-Wallace Little-Wallace commented Nov 21, 2022

Signed-off-by: Little-Wallace bupt2013211450@gmail.com

I hereby agree to the terms of the Singularity Data, Inc. Contributor License Agreement.

What's changed and what's your intention?

PLEASE DO NOT LEAVE THIS EMPTY !!!

Please explain IN DETAIL what the changes are in this PR and why they are needed:

  • Summarize your change (mandatory)
  • How does this PR work? Need a brief introduction for the changed logic (optional)
  • Describe clearly one logical change and avoid lazy messages (optional)
  • Describe any limitations of the current code (optional)

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Documentation

If your pull request contains user-facing changes, please specify the types of the changes, and create a release note. Otherwise, please feel free to remove this section.

Types of user-facing changes

Please keep the types that apply to your changes, and remove those that do not apply.

  • Installation and deployment
  • Connector (sources & sinks)
  • SQL commands, functions, and operators
  • RisingWave cluster configuration changes
  • Other (please specify in the release note below)

Release note

Please create a release note for your changes. In the release note, focus on the impact on users, and mention the environment or conditions where the impact may occur.

Refer to a related PR or issue link (optional)

Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
@BugenZhao
Copy link
Member

BugenZhao commented Nov 21, 2022

Should we encapsulate this logic in LruCache?

size: (sst.file_size - sst.meta_offset) as usize,
};
async move {
let now = Instant::now();
Copy link
Contributor

Choose a reason for hiding this comment

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

we can use minstant::Instant

@codecov
Copy link

codecov bot commented Nov 21, 2022

Codecov Report

Merging #6483 (4da5737) into main (709e1be) will increase coverage by 0.00%.
The diff coverage is 82.06%.

@@           Coverage Diff            @@
##             main    #6483    +/-   ##
========================================
  Coverage   73.94%   73.94%            
========================================
  Files         981      982     +1     
  Lines      159159   160121   +962     
========================================
+ Hits       117690   118406   +716     
- Misses      41469    41715   +246     
Flag Coverage Δ
rust 73.94% <82.06%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
src/batch/src/executor/row_seq_scan.rs 20.00% <0.00%> (-0.21%) ⬇️
src/batch/src/lib.rs 100.00% <ø> (ø)
src/frontend/src/handler/variable.rs 0.00% <0.00%> (ø)
...ntend/src/optimizer/plan_node/stream_index_scan.rs 41.40% <0.00%> (-0.33%) ⬇️
src/frontend/src/session.rs 40.36% <0.00%> (ø)
src/sqlparser/src/keywords.rs 100.00% <ø> (ø)
src/storage/src/hummock/event_handler/mod.rs 0.00% <ø> (ø)
src/storage/src/hummock/local_version/mod.rs 100.00% <ø> (ø)
...e/src/hummock/shared_buffer/shared_buffer_batch.rs 89.51% <0.00%> (+0.96%) ⬆️
src/storage/src/hummock/sstable_store.rs 59.53% <0.00%> (+0.29%) ⬆️
... and 49 more

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

@BugenZhao
Copy link
Member

Should we encapsulate this logic in LruCache?

For example, moka will automatically retry if the future aborts.

                        // Somebody else (a future containing `get_with`/`try_get_with`)
                        // has been aborted.
                        WaiterValue::EnclosingFutureAborted => {
                            retries += 1;
                            panic_if_retry_exhausted_for_aborting(retries, MAX_RETRIES);
                            // Retry from the beginning.
                            continue;
                        }

@hzxa21
Copy link
Collaborator

hzxa21 commented Nov 21, 2022

Should we encapsulate this logic in LruCache?

For example, moka will automatically retry if the future aborts.

                        // Somebody else (a future containing `get_with`/`try_get_with`)
                        // has been aborted.
                        WaiterValue::EnclosingFutureAborted => {
                            retries += 1;
                            panic_if_retry_exhausted_for_aborting(retries, MAX_RETRIES);
                            // Retry from the beginning.
                            continue;
                        }

Good point. It is better to put the logic in the implementation of lookup_with_request_dedup.

Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
@Little-Wallace
Copy link
Contributor Author

Should we encapsulate this logic in LruCache?

Done

Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants