You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@horaedb.apache.org by "jiacai2050 (via GitHub)" <gi...@apache.org> on 2024/10/16 03:39:51 UTC
[PR] fix: remove unused length in wal record [horaedb]
jiacai2050 opened a new pull request, #1576:
URL: https://github.com/apache/horaedb/pull/1576
## Rationale
`length` field is not need in wal record, it's duplicated with value_length.
## Detailed Changes
- Remove rocksdb-wal from default features
## Test Plan
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@horaedb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@horaedb.apache.org
For additional commands, e-mail: commits-help@horaedb.apache.org
Re: [PR] fix: remove redundancy length field in wal record [horaedb]
Posted by "chunshao90 (via GitHub)" <gi...@apache.org>.
chunshao90 commented on code in PR #1576:
URL: https://github.com/apache/horaedb/pull/1576#discussion_r1802634390
##########
src/wal/src/local_storage_impl/record_encoding.rs:
##########
@@ -172,38 +172,26 @@ impl RecordEncoding {
// Verify version
ensure!(
- version == self.version,
+ version == self.expected_version,
Version {
- expected: self.version,
+ expected: self.expected_version,
given: version
}
);
- // Read CRC
let crc = buf.try_get_u32().context(Decoding)?;
-
- // Read length
- let length = buf.try_get_u32().context(Decoding)?;
- ensure!(
- length > 0,
- LengthMismatch {
- expected: 1usize,
- actual: 0usize
- }
- );
-
- // Ensure the buf is long enough
- ensure!(
- buf.remaining() >= length as usize,
- LengthMismatch {
- expected: length as usize,
- actual: buf.remaining()
- }
- );
+ let table_id = buf.try_get_u64().context(Decoding)?;
+ let sequence_num = buf.try_get_u64().context(Decoding)?;
+ let value_length = buf.try_get_u32().context(Decoding)?;
+ let value = buf[0..value_length as usize].to_vec();
// Verify CRC
- let data = &buf[0..length as usize];
- let computed_crc = crc32fast::hash(data);
+ let mut h = Hasher::new();
Review Comment:
Change the calculation logic? Can you comment out the calculation logic?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@horaedb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@horaedb.apache.org
For additional commands, e-mail: commits-help@horaedb.apache.org
Re: [PR] fix: remove redundancy length field in wal record [horaedb]
Posted by "jiacai2050 (via GitHub)" <gi...@apache.org>.
jiacai2050 commented on code in PR #1576:
URL: https://github.com/apache/horaedb/pull/1576#discussion_r1802745561
##########
src/wal/src/local_storage_impl/record_encoding.rs:
##########
@@ -172,38 +172,26 @@ impl RecordEncoding {
// Verify version
ensure!(
- version == self.version,
+ version == self.expected_version,
Version {
- expected: self.version,
+ expected: self.expected_version,
given: version
}
);
- // Read CRC
let crc = buf.try_get_u32().context(Decoding)?;
-
- // Read length
- let length = buf.try_get_u32().context(Decoding)?;
- ensure!(
- length > 0,
- LengthMismatch {
- expected: 1usize,
- actual: 0usize
- }
- );
-
- // Ensure the buf is long enough
- ensure!(
- buf.remaining() >= length as usize,
- LengthMismatch {
- expected: length as usize,
- actual: buf.remaining()
- }
- );
+ let table_id = buf.try_get_u64().context(Decoding)?;
+ let sequence_num = buf.try_get_u64().context(Decoding)?;
+ let value_length = buf.try_get_u32().context(Decoding)?;
+ let value = buf[0..value_length as usize].to_vec();
// Verify CRC
- let data = &buf[0..length as usize];
- let computed_crc = crc32fast::hash(data);
+ let mut h = Hasher::new();
Review Comment:
fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@horaedb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@horaedb.apache.org
For additional commands, e-mail: commits-help@horaedb.apache.org
Re: [PR] fix: remove redundancy length field in wal record [horaedb]
Posted by "jiacai2050 (via GitHub)" <gi...@apache.org>.
jiacai2050 merged PR #1576:
URL: https://github.com/apache/horaedb/pull/1576
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@horaedb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@horaedb.apache.org
For additional commands, e-mail: commits-help@horaedb.apache.org