[4.0] remove unused savepoint logic in RedoLog's mutatorRow

This commit is contained in:
chinaxing
2022-11-02 19:38:26 +00:00
committed by wangzelin.wzl
parent 109c3518df
commit e49ecdcc76
4 changed files with 7 additions and 35 deletions

View File

@ -57,7 +57,7 @@ struct RedoDataNode
uint32_t modify_count_; uint32_t modify_count_;
uint32_t acc_checksum_; uint32_t acc_checksum_;
int64_t version_; int64_t version_;
int32_t flag_; int32_t flag_; // currently, unused
int64_t seq_no_; int64_t seq_no_;
ObITransCallback *callback_; ObITransCallback *callback_;
common::ObTabletID tablet_id_; common::ObTabletID tablet_id_;

View File

@ -39,7 +39,7 @@ ObMemtableMutatorMeta::ObMemtableMutatorMeta():
data_crc_(0), data_crc_(0),
data_size_(0), data_size_(0),
row_count_(0), row_count_(0),
have_rollback_to_savepoint_(1) unused_(0)
{ {
} }
@ -159,8 +159,8 @@ int64_t ObMemtableMutatorMeta::to_string(char *buffer, const int64_t length) con
{ {
int64_t pos = 0; int64_t pos = 0;
common::databuff_printf(buffer, length, pos, common::databuff_printf(buffer, length, pos,
"%p data_crc=%x meta_size=%d data_size=%d row_count=%d have_rollback_to_savepoint=%d", "%p data_crc=%x meta_size=%d data_size=%d row_count=%d",
this, data_crc_, meta_size_, data_size_, row_count_, have_rollback_to_savepoint_); this, data_crc_, meta_size_, data_size_, row_count_);
return pos; return pos;
} }
@ -169,23 +169,6 @@ bool ObMemtableMutatorMeta::is_row_start() const
return ObTransRowFlag::is_row_start(flags_); return ObTransRowFlag::is_row_start(flags_);
} }
int ObMemtableMutatorMeta::set_savepoint(const uint32_t flag) {
int ret = OB_SUCCESS;
if (flag != 0 && flag != 1) {
TRANS_LOG(WARN, "invalid argument", K(flag));
ret = OB_INVALID_ARGUMENT;
} else {
have_rollback_to_savepoint_ = flag;
}
return ret;
}
uint32_t ObMemtableMutatorMeta::get_savepoint() const {
return have_rollback_to_savepoint_;
}
//only meta_crc is newly generated here, other information will keep unchanged //only meta_crc is newly generated here, other information will keep unchanged
void ObMemtableMutatorMeta::generate_new_header() void ObMemtableMutatorMeta::generate_new_header()
{ {
@ -863,7 +846,6 @@ int ObMutatorWriter::append_row_kv(
const ObMemtableKey *mtk = &redo.key_; const ObMemtableKey *mtk = &redo.key_;
uint64_t cluster_version = 0; uint64_t cluster_version = 0;
bool is_with_head = true; bool is_with_head = true;
uint32 have_rollback_to_savepoint = redo.flag_;
if (OB_ISNULL(redo.callback_)) { if (OB_ISNULL(redo.callback_)) {
is_with_head = false; is_with_head = false;
} else if (OB_FAIL(redo.callback_->get_cluster_version(cluster_version))) { } else if (OB_FAIL(redo.callback_->get_cluster_version(cluster_version))) {
@ -918,9 +900,6 @@ int ObMutatorWriter::append_row_kv(
} }
} else if (OB_FAIL(meta_.inc_row_count())) { } else if (OB_FAIL(meta_.inc_row_count())) {
TRANS_LOG(WARN, "meta inc_row_count failed", K(ret)); TRANS_LOG(WARN, "meta inc_row_count failed", K(ret));
} else if (have_rollback_to_savepoint == 1 &&
OB_FAIL(meta_.set_savepoint(have_rollback_to_savepoint))) {
TRANS_LOG(WARN, "set savepoint flag failed", K(ret));
} else { } else {
buf_.get_position() = tmp_pos; buf_.get_position() = tmp_pos;
} }
@ -938,7 +917,6 @@ int ObMutatorWriter::append_row(
const bool is_with_head) const bool is_with_head)
{ {
int ret = OB_SUCCESS; int ret = OB_SUCCESS;
uint32 have_rollback_to_savepoint = row.get_savepoint_flag();
ObMutatorRowHeader row_header; ObMutatorRowHeader row_header;
row_header.mutator_type_ = MutatorType::MUTATOR_ROW; row_header.mutator_type_ = MutatorType::MUTATOR_ROW;
//TODO replace pkey with tablet_id for clog_encrypt_info //TODO replace pkey with tablet_id for clog_encrypt_info
@ -964,9 +942,6 @@ int ObMutatorWriter::append_row(
} }
} else if (OB_FAIL(meta_.inc_row_count())) { } else if (OB_FAIL(meta_.inc_row_count())) {
TRANS_LOG(WARN, "meta inc_row_count failed", K(ret)); TRANS_LOG(WARN, "meta inc_row_count failed", K(ret));
} else if (have_rollback_to_savepoint == 1 &&
OB_FAIL(meta_.set_savepoint(have_rollback_to_savepoint))) {
TRANS_LOG(WARN, "set savepoint flag failed", K(ret));
} else { } else {
buf_.get_position() = tmp_pos; buf_.get_position() = tmp_pos;
} }

View File

@ -66,8 +66,6 @@ public:
int64_t get_meta_size() const { return meta_size_; } int64_t get_meta_size() const { return meta_size_; }
int64_t get_data_size() const { return data_size_; } int64_t get_data_size() const { return data_size_; }
bool is_row_start() const; bool is_row_start() const;
int set_savepoint(const uint32_t is_savepoint);
uint32_t get_savepoint() const;
public: public:
int64_t get_serialize_size() const; int64_t get_serialize_size() const;
@ -87,7 +85,7 @@ private:
uint32_t data_crc_; uint32_t data_crc_;
uint32_t data_size_; uint32_t data_size_;
uint32_t row_count_; uint32_t row_count_;
uint32_t have_rollback_to_savepoint_; uint32_t unused_;
DISALLOW_COPY_AND_ASSIGN(ObMemtableMutatorMeta); DISALLOW_COPY_AND_ASSIGN(ObMemtableMutatorMeta);
}; };
@ -190,7 +188,7 @@ public:
share::ObEncryptMeta &final_encrypt_meta, share::ObEncryptMeta &final_encrypt_meta,
share::ObCLogEncryptStatMap &encrypt_stat_map, share::ObCLogEncryptStatMap &encrypt_stat_map,
const bool is_big_row = false); const bool is_big_row = false);
uint32_t get_savepoint_flag() const { return flag_; }; uint32_t get_flag() const { return flag_; };
TO_STRING_KV(K_(row_size), TO_STRING_KV(K_(row_size),
K_(table_id), K_(table_id),
@ -212,7 +210,7 @@ public:
ObRowData old_row_; ObRowData old_row_;
uint32_t acc_checksum_; uint32_t acc_checksum_;
int64_t version_; int64_t version_;
int32_t flag_; // savepoint flag int32_t flag_; // currently, unused
uint8_t rowid_version_; uint8_t rowid_version_;
}; };

View File

@ -74,7 +74,6 @@ int ObRedoLogGenerator::fill_redo_log(char *buf,
} else { } else {
helper.reset(); helper.reset();
ObMutatorWriter mmw; ObMutatorWriter mmw;
mmw.get_meta().set_savepoint(0);
mmw.set_buffer(buf, buf_len - buf_pos); mmw.set_buffer(buf, buf_len - buf_pos);
RedoDataNode redo; RedoDataNode redo;
TableLockRedoDataNode table_lock_redo; TableLockRedoDataNode table_lock_redo;