[OBKV] fix observer coredump or report -4016 when execute multi-cf hbase put with lob column

This commit is contained in:
shenyunlong.syl 2024-12-17 11:18:34 +00:00 committed by ob-robot
parent 54a4547147
commit 1fcf2c2aae
2 changed files with 13 additions and 7 deletions

View File

@ -191,11 +191,17 @@ int ObTableBatchService::adjust_entities(ObTableBatchCtx &ctx)
ObTableCtx &tb_ctx = ctx.tb_ctx_;
// first entity has beed adjusted when create tb_ctx
for (int64_t i = 1; OB_SUCC(ret) && i < ctx.ops_->count(); ++i) {
const ObTableOperation &op = ctx.ops_->at(i);
tb_ctx.set_entity(&op.entity());
if (OB_FAIL(tb_ctx.adjust_entity())) {
LOG_WARN("fail to adjust entity", K(ret));
// but in hbase, the tb_ctx maybe reused and first entity
// also need to be adjusted
for (int64_t i = 0; OB_SUCC(ret) && i < ctx.ops_->count(); ++i) {
if (i == 0 && ctx.entity_type_ != ObTableEntityType::ET_HKV) {
// do noting
} else {
const ObTableOperation &op = ctx.ops_->at(i);
tb_ctx.set_entity(&op.entity());
if (OB_FAIL(tb_ctx.adjust_entity())) {
LOG_WARN("fail to adjust entity", K(ret));
}
}
}
@ -773,7 +779,7 @@ int ObTableBatchService::htable_put(ObTableBatchCtx &ctx)
const ObTableOperation &op = ctx.ops_->at(i);
ObTableOperationResult single_op_result;
tb_ctx.set_entity(&op.entity());
if (i > 0 && OB_FAIL(tb_ctx.adjust_entity())) { // first entity adjust in init_single_op_tb_ctx
if (OB_FAIL(tb_ctx.adjust_entity())) { // first entity adjust in init_single_op_tb_ctx
LOG_WARN("fail to adjust entity", K(ret));
} else if (OB_FAIL(ObTableOpWrapper::process_op_with_spec(tb_ctx, spec, single_op_result))) {
LOG_WARN("fail to process op with spec", K(ret));

View File

@ -1743,7 +1743,7 @@ public:
OB_INLINE void set_tablet_id(ObTabletID tablet_id) { tablet_id_ = tablet_id; }
OB_INLINE void set_option_flag(uint64_t option_flag) { option_flag_ = option_flag; }
OB_INLINE int add_single_op(ObTableSingleOp single_op) { return single_ops_.push_back(single_op); }
OB_INLINE int add_single_op(const ObTableSingleOp &single_op) { return single_ops_.push_back(single_op); }
TO_STRING_KV(K_(tablet_id),
K_(option_flag),