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 W1D6 test #48

Merged
merged 1 commit into from
Feb 24, 2024
Merged

Fix W1D6 test #48

merged 1 commit into from
Feb 24, 2024

Conversation

yyin-dev
Copy link
Contributor

The assert is changed to: assert!(min_num <= iter.num_active_iterators() && iter.num_active_iterators() < max_num);

Reasoning:
The sstables should look like the following (format: (id, first_key, last_key)):

[(0, b"00001", b"00999"), 
(1, b"01000", b"01999"), 
(2, b"02000", b"02999"), 
(3, b"03000", b"03999"), 
(4, b"04000", b"04999"), 
(5, b"05000", b"05999"), 
(6, b"06000", b"06999"), 
(7, b"07000", b"07999"), 
(8, b"08000", b"08999"), 
(9, b"09000", b"09999")]

Given query

let iter = storage
        .scan(
            Bound::Included(format!("{:05}", 5000).as_bytes()),
            Bound::Excluded(format!("{:05}", 6000).as_bytes()),
        )
        .unwrap();

it's correct for the filter to only return the Sstable with id=5, and thus min_num <= iter.num_active_iterators().

@skyzh skyzh self-requested a review February 24, 2024 21:14
@skyzh skyzh merged commit f436b3f into skyzh:main Feb 24, 2024
1 check passed
@skyzh
Copy link
Owner

skyzh commented Feb 24, 2024

Thanks!

@yyin-dev yyin-dev deleted the yy.fix-test.w1d6 branch February 24, 2024 23:34
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.

2 participants