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(state table): use memcpmarble's max value to encoding instead hack with NULL byte+1 #11912

Closed
st1page opened this issue Aug 28, 2023 · 2 comments
Labels
help wanted Issues that need help from contributors
Milestone

Comments

@st1page
Copy link
Contributor

st1page commented Aug 28, 2023

if prefix_serializer.as_ref().unwrap().get_order_types().first().unwrap().is_ascending() {
// We either serialize null into `0u8`, data into `(1u8 || scalar)`, or serialize null
// into `1u8`, data into `(0u8 || scalar)`. We do not want to delete null
// here, so `range_begin_suffix` cannot be `vec![]` when null is represented as `0u8`.
let range_begin_suffix = vec![*first_byte];
for vnode in self.vnodes.iter_vnodes() {
let mut range_begin = vnode.to_be_bytes().to_vec();
let mut range_end = range_begin.clone();
range_begin.extend(&range_begin_suffix);
range_end.extend(&watermark_suffix);
delete_ranges.push((
Bound::Included(Bytes::from(range_begin)),
Bound::Excluded(Bytes::from(range_end)),
));
}
} else {
assert_ne!(*first_byte, u8::MAX);
let following_bytes = next_key(&watermark_suffix[1..]);
if !following_bytes.is_empty() {
for vnode in self.vnodes.iter_vnodes() {
let mut range_begin = vnode.to_be_bytes().to_vec();
let mut range_end = range_begin.clone();
range_begin.push(*first_byte);
range_begin.extend(&following_bytes);
range_end.push(first_byte + 1);
delete_ranges.push((
Bound::Included(Bytes::from(range_begin)),
Bound::Excluded(Bytes::from(range_end)),
));
}
}
}
}

@github-actions github-actions bot added this to the release-1.2 milestone Aug 28, 2023
@fuyufjh
Copy link
Member

fuyufjh commented Aug 28, 2023

?

@st1page st1page changed the title refactor refactor(state table): use memcpmarble's max value to encoding instead hack with NULL byte+1 Aug 28, 2023
@st1page st1page modified the milestones: release-1.2, release-1.3 Sep 11, 2023
@st1page st1page self-assigned this Sep 11, 2023
@st1page st1page modified the milestones: release-1.3, release-1.4 Oct 10, 2023
@st1page st1page modified the milestones: release-1.4, release-1.5 Nov 8, 2023
@st1page st1page removed their assignment Dec 5, 2023
@st1page st1page modified the milestones: release-1.7, release-1.8 Mar 6, 2024
@st1page st1page added the help wanted Issues that need help from contributors label Apr 8, 2024
@st1page st1page modified the milestones: release-1.8, release-1.9 Apr 8, 2024
@st1page
Copy link
Contributor Author

st1page commented May 14, 2024

close after #14526

@st1page st1page closed this as completed May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issues that need help from contributors
Projects
None yet
Development

No branches or pull requests

2 participants