fix standby tenant archive and remove lag target
This commit is contained in:
@ -4259,7 +4259,6 @@ ObLogArchiveDestAtrr::ObLogArchiveDestAtrr()
|
||||
binding_ = Binding::OPTIONAL;
|
||||
dest_id_ = 0;
|
||||
piece_switch_interval_ = OB_DEFAULT_PIECE_SWITCH_INTERVAL;
|
||||
lag_target_ = OB_DEFAULT_LAG_TARGET;
|
||||
state_.set_enable();
|
||||
}
|
||||
|
||||
@ -4279,22 +4278,6 @@ int ObLogArchiveDestAtrr::set_piece_switch_interval(const char *buf)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObLogArchiveDestAtrr::set_lag_target(const char *buf)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
bool is_valid = false;
|
||||
if (OB_ISNULL(buf)) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("invalid args", K(ret), KP(buf));
|
||||
} else if (OB_FALSE_IT(lag_target_ = ObConfigTimeParser::get(buf, is_valid))) {
|
||||
} else if (!is_valid || !is_lag_target_valid()) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
lag_target_ = 0;
|
||||
LOG_WARN("invalid lag_target", K(ret), K(buf));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObLogArchiveDestAtrr::set_log_archive_dest(const common::ObString &str)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
@ -4339,7 +4322,6 @@ bool ObLogArchiveDestAtrr::is_valid() const
|
||||
return is_dest_valid()
|
||||
&& dest_id_ > 0
|
||||
&& is_piece_switch_interval_valid()
|
||||
&& is_lag_target_valid()
|
||||
&& state_.is_valid();
|
||||
};
|
||||
|
||||
@ -4353,12 +4335,6 @@ bool ObLogArchiveDestAtrr::is_piece_switch_interval_valid() const
|
||||
return piece_switch_interval_ >= OB_MIN_LOG_ARCHIVE_PIECE_SWITH_INTERVAL;
|
||||
}
|
||||
|
||||
bool ObLogArchiveDestAtrr::is_lag_target_valid() const
|
||||
{
|
||||
return lag_target_ >= OB_MIN_LAG_TARGET
|
||||
&& lag_target_ <= OB_MAX_LAG_TARGET;
|
||||
}
|
||||
|
||||
int ObLogArchiveDestAtrr::gen_config_items(common::ObIArray<BackupConfigItemPair> &items) const
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
@ -4415,18 +4391,6 @@ int ObLogArchiveDestAtrr::gen_config_items(common::ObIArray<BackupConfigItemPair
|
||||
LOG_WARN("failed to push backup config", K(ret));
|
||||
}
|
||||
|
||||
// gen lag_target config
|
||||
if (OB_FAIL(ret)) {
|
||||
} else if (OB_FAIL(config.key_.assign(OB_STR_LAG_TARGET))) {
|
||||
LOG_WARN("failed to assign key", K(ret));
|
||||
} else if (OB_FAIL(get_lag_target(tmp.ptr(), tmp.capacity()))) {
|
||||
LOG_WARN("failed to get lag target", K(ret));
|
||||
} else if (OB_FAIL(config.value_.assign(tmp.ptr()))) {
|
||||
LOG_WARN("failed to assign value", K(ret));
|
||||
} else if(OB_FAIL(items.push_back(config))) {
|
||||
LOG_WARN("failed to push backup config", K(ret));
|
||||
}
|
||||
|
||||
// gen state config
|
||||
if (OB_FAIL(ret)) {
|
||||
} else if (OB_FAIL(config.key_.assign(OB_STR_STATE))) {
|
||||
@ -4480,11 +4444,6 @@ int ObLogArchiveDestAtrr::get_piece_switch_interval(char *buf, int64_t len) cons
|
||||
return ObBackupUtils::convert_timestamp_to_timestr(piece_switch_interval_, buf, len);
|
||||
}
|
||||
|
||||
int ObLogArchiveDestAtrr::get_lag_target(char *buf, int64_t len) const
|
||||
{
|
||||
return ObBackupUtils::convert_timestamp_to_timestr(lag_target_, buf, len);
|
||||
}
|
||||
|
||||
int ObLogArchiveDestAtrr::assign(const ObLogArchiveDestAtrr& that)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
@ -4495,7 +4454,6 @@ int ObLogArchiveDestAtrr::assign(const ObLogArchiveDestAtrr& that)
|
||||
binding_ = that.binding_;
|
||||
dest_id_ = that.dest_id_;
|
||||
piece_switch_interval_ = that.piece_switch_interval_;
|
||||
lag_target_ = that.lag_target_;
|
||||
if (OB_FAIL(dest_.deep_copy(that.dest_))) {
|
||||
LOG_WARN("fail to deep copy dest", K(ret));
|
||||
} else if (OB_FAIL(state_.assign(that.state_))) {
|
||||
|
||||
Reference in New Issue
Block a user