Support delay schedule for ddl scheduler
This commit is contained in:
		
				
					committed by
					
						
						wangzelin.wzl
					
				
			
			
				
	
			
			
			
						parent
						
							0bd3fe9183
						
					
				
				
					commit
					3a7d00b66c
				
			@ -247,7 +247,8 @@ public:
 | 
			
		||||
      task_type_(task_type), trace_id_(), tenant_id_(0), object_id_(0), schema_version_(0),
 | 
			
		||||
      target_object_id_(0), task_status_(share::ObDDLTaskStatus::PREPARE), snapshot_version_(0), ret_code_(OB_SUCCESS), task_id_(0),
 | 
			
		||||
      parent_task_id_(0), parent_task_key_(), task_version_(0), parallelism_(0),
 | 
			
		||||
      allocator_(lib::ObLabel("DdlTask")), compat_mode_(lib::Worker::CompatMode::INVALID), err_code_occurence_cnt_(0)
 | 
			
		||||
      allocator_(lib::ObLabel("DdlTask")), compat_mode_(lib::Worker::CompatMode::INVALID), err_code_occurence_cnt_(0),
 | 
			
		||||
      delay_schedule_time_(0), next_schedule_ts_(0)
 | 
			
		||||
  {}
 | 
			
		||||
  virtual ~ObDDLTask() {}
 | 
			
		||||
  virtual int process() = 0;
 | 
			
		||||
@ -293,6 +294,8 @@ public:
 | 
			
		||||
      const common::ObIArray<common::ObTabletID> &tablet_ids);
 | 
			
		||||
  void set_sys_task_id(const TraceId &sys_task_id) { sys_task_id_ = sys_task_id; }
 | 
			
		||||
  const TraceId &get_sys_task_id() const { return sys_task_id_; }
 | 
			
		||||
  void calc_next_schedule_ts(int ret_code);
 | 
			
		||||
  bool need_schedule() { return next_schedule_ts_ <= ObTimeUtility::current_time(); }
 | 
			
		||||
  #ifdef ERRSIM
 | 
			
		||||
  int check_errsim_error();
 | 
			
		||||
  #endif
 | 
			
		||||
@ -302,7 +305,7 @@ public:
 | 
			
		||||
      K(target_object_id_), K(task_status_), K(snapshot_version_),
 | 
			
		||||
      K_(ret_code), K_(task_id), K_(parent_task_id), K_(parent_task_key),
 | 
			
		||||
      K_(task_version), K_(parallelism), K_(ddl_stmt_str), K_(compat_mode),
 | 
			
		||||
      K_(sys_task_id), K_(err_code_occurence_cnt));
 | 
			
		||||
      K_(sys_task_id), K_(err_code_occurence_cnt), K_(next_schedule_ts), K_(delay_schedule_time));
 | 
			
		||||
protected:
 | 
			
		||||
  virtual bool is_error_need_retry(const int ret_code)
 | 
			
		||||
  {
 | 
			
		||||
@ -333,6 +336,8 @@ protected:
 | 
			
		||||
  lib::Worker::CompatMode compat_mode_;
 | 
			
		||||
  TraceId sys_task_id_;
 | 
			
		||||
  int64_t err_code_occurence_cnt_; // occurence count for all error return codes not in white list.
 | 
			
		||||
  int64_t delay_schedule_time_;
 | 
			
		||||
  int64_t next_schedule_ts_;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
enum ColChecksumStat
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user