return ob_not_master if txn was killed by LS GC routine
This commit is contained in:
		@ -293,13 +293,20 @@ int ObSingleRowGetter::get_next_row(ObNewRow *&row)
 | 
			
		||||
  }
 | 
			
		||||
  if (OB_SUCC(ret) || OB_ITER_END == ret) {
 | 
			
		||||
    // check txn status not aborted, which cause readout incorrect result
 | 
			
		||||
    if (store_ctx_->mvcc_acc_ctx_.snapshot_.tx_id_.is_valid() &&
 | 
			
		||||
        store_ctx_->mvcc_acc_ctx_.mem_ctx_ &&
 | 
			
		||||
        store_ctx_->mvcc_acc_ctx_.mem_ctx_->is_tx_rollbacked()) {
 | 
			
		||||
      // The txn has been killed during normal processing. So we return
 | 
			
		||||
      // OB_TRANS_KILLED to prompt this abnormal state.
 | 
			
		||||
      ret = OB_TRANS_KILLED;
 | 
			
		||||
      STORAGE_LOG(WARN, "txn has terminated", K(ret));
 | 
			
		||||
    auto &acc_ctx = store_ctx_->mvcc_acc_ctx_;
 | 
			
		||||
    if (acc_ctx.snapshot_.tx_id_.is_valid() &&
 | 
			
		||||
        acc_ctx.mem_ctx_ &&
 | 
			
		||||
        acc_ctx.mem_ctx_->is_tx_rollbacked()) {
 | 
			
		||||
      if (acc_ctx.mem_ctx_->is_for_replay()) {
 | 
			
		||||
        // goes here means the txn was killed due to LS's GC etc,
 | 
			
		||||
        // return NOT_MASTER
 | 
			
		||||
        ret = OB_NOT_MASTER;
 | 
			
		||||
      } else {
 | 
			
		||||
        // The txn has been killed during normal processing. So we return
 | 
			
		||||
        // OB_TRANS_KILLED to prompt this abnormal state.
 | 
			
		||||
        ret = OB_TRANS_KILLED;
 | 
			
		||||
        STORAGE_LOG(WARN, "txn has terminated", K(ret), "tx_id", acc_ctx.tx_id_);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  return ret;
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user