[bugfix] fix compatibility of log_block_header
This commit is contained in:
parent
a7a929259e
commit
58a23f5f7b
@ -149,7 +149,7 @@ DEFINE_DESERIALIZE(LogBlockHeader)
|
||||
|| OB_FAIL(serialization::decode_i32(buf, data_len, new_pos, &flag_))
|
||||
|| OB_FAIL(min_lsn_.deserialize(buf, data_len, new_pos))
|
||||
|| OB_FAIL(min_scn_.fixed_deserialize(buf, data_len, new_pos))
|
||||
|| OB_FAIL(max_scn_.fixed_deserialize(buf, data_len, new_pos))
|
||||
|| OB_FAIL(max_scn_.fixed_deserialize_without_transform(buf, data_len, new_pos))
|
||||
|| OB_FAIL(serialization::decode_i64(buf, data_len, new_pos, reinterpret_cast<int64_t*>(&curr_block_id_)))
|
||||
|| OB_FAIL(serialization::decode_i64(buf, data_len, new_pos, &palf_id_))
|
||||
|| OB_FAIL(serialization::decode_i64(buf, data_len, new_pos, &checksum_))) {
|
||||
|
@ -476,7 +476,7 @@ int SCN::to_yson(char *buf, const int64_t buf_len, int64_t &pos) const
|
||||
return oceanbase::yson::databuff_encode_elements(buf, buf_len, pos, OB_ID(scn_val), val_);
|
||||
}
|
||||
|
||||
int SCN::fixed_deserialize(const char* buf, const int64_t data_len, int64_t& pos)
|
||||
int SCN::fixed_deserialize_without_transform(const char* buf, const int64_t data_len, int64_t& pos)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
int64_t new_pos = pos;
|
||||
@ -488,6 +488,16 @@ int SCN::fixed_deserialize(const char* buf, const int64_t data_len, int64_t& pos
|
||||
PALF_LOG(WARN, "failed to decode val_", K(buf), K(data_len), K(new_pos), K(ret));
|
||||
} else {
|
||||
pos = new_pos;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int SCN::fixed_deserialize(const char* buf, const int64_t data_len, int64_t& pos)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (OB_FAIL(fixed_deserialize_without_transform(buf, data_len, pos))) {
|
||||
PALF_LOG(WARN, "failed to fixed_deserialize_without_transform", K(buf), K(data_len), K(pos), K(ret));
|
||||
} else {
|
||||
(void)transform_max_();
|
||||
}
|
||||
return ret;
|
||||
|
@ -109,6 +109,8 @@ public:
|
||||
|
||||
//fixed length serialization
|
||||
int fixed_serialize(char* buf, const int64_t buf_len, int64_t& pos) const;
|
||||
//used for checksum with old value of INT64_MAX, if transforming max value, checksum will change;
|
||||
int fixed_deserialize_without_transform(const char* buf, const int64_t data_len, int64_t& pos);
|
||||
int fixed_deserialize(const char* buf, const int64_t data_len, int64_t& pos);
|
||||
int64_t get_fixed_serialize_size(void) const;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user