fix a problem when query v$ob_archive_dest_status
This commit is contained in:
parent
3dac957f5e
commit
cb1ec965d4
@ -63,6 +63,15 @@ void ObVirtualArchiveDestStatus::ObArchiveDestStatusInfo::reset()
|
||||
comment_.reset();
|
||||
}
|
||||
|
||||
bool ObVirtualArchiveDestStatus::ObArchiveDestStatusInfo::is_valid()
|
||||
{
|
||||
return tenant_id_ != OB_INVALID_TENANT_ID
|
||||
&& dest_id_ != OB_INVALID_DEST_ID
|
||||
&& !status_.is_empty()
|
||||
&& checkpoint_scn_ != OB_INVALID_SCN_VAL
|
||||
&& !synchronized_.is_empty();
|
||||
}
|
||||
|
||||
int ObVirtualArchiveDestStatus::init(ObMySQLProxy *sql_proxy)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
@ -150,7 +159,8 @@ int ObVirtualArchiveDestStatus::inner_get_next_row(common::ObNewRow *&row)
|
||||
if (OB_FAIL(get_ls_max_scn_(curr_tenant))) {
|
||||
SERVER_LOG(WARN, "get ls max scn failed", K(curr_tenant), K(ret));
|
||||
} else if (ls_checkpoint_map_.count() == 0 || ls_end_map_.count() == 0 || ls_checkpoint_map_.count() != ls_end_map_.count()) {
|
||||
SERVER_LOG(WARN, "map may be empty", K(ls_end_map_.count()), K(ls_checkpoint_map_.count()));
|
||||
SERVER_LOG(WARN, "map may be empty", K(curr_tenant), K(curr_dest), K(ls_end_map_.count()), K(ls_checkpoint_map_.count()));
|
||||
continue;
|
||||
} else if (OB_FAIL(compare_scn_map_())) {
|
||||
SERVER_LOG(WARN, "compare scn map failed", K(ret));
|
||||
} else if (is_synced_) {
|
||||
@ -166,7 +176,11 @@ int ObVirtualArchiveDestStatus::inner_get_next_row(common::ObNewRow *&row)
|
||||
}
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret) && OB_FAIL(get_full_row_(table_schema_, dest_status_info, columns))) {
|
||||
if (OB_FAIL(ret)) {
|
||||
SERVER_LOG(WARN, "fail to get archive dest status", K(curr_tenant), K(curr_dest), KR(ret));
|
||||
} else if (!dest_status_info.is_valid()) {
|
||||
SERVER_LOG(WARN, "dest status info is invalid", K(curr_tenant), K(curr_dest), K(dest_status_info));
|
||||
} else if (OB_FAIL(get_full_row_(table_schema_, dest_status_info, columns))) {
|
||||
SERVER_LOG(WARN, "failed to get full row", "table_schema", *table_schema_, K(dest_status_info), K(ret));
|
||||
} else if (OB_FAIL(project_row(columns, cur_row_))) {
|
||||
SERVER_LOG(WARN, "failed to project row", K(ret));
|
||||
@ -632,4 +646,4 @@ int ObVirtualArchiveDestStatus::get_log_archive_used_piece_id_(const uint64_t te
|
||||
return ret;
|
||||
}
|
||||
}// end namespace observer
|
||||
}// end namespace oceanbase
|
||||
}// end namespace oceanbase
|
@ -52,6 +52,7 @@ private:
|
||||
ObFixedLengthString<MAX_SYNC_TYPE_LENTH> synchronized_;
|
||||
share::ObBackupDefaultFixedLenString comment_;
|
||||
void reset();
|
||||
bool is_valid();
|
||||
TO_STRING_KV(K_(tenant_id), K_(dest_id), K_(status), K_(path), K_(checkpoint_scn),
|
||||
K_(synchronized),K_(comment));
|
||||
};
|
||||
@ -97,4 +98,4 @@ private:
|
||||
};
|
||||
}//end namespace observer
|
||||
}//end namespace oceanbase
|
||||
#endif //OCEANBASE_OBSERVER_OB_ALL_VIRTUAL_ARCHIVE_DEST_STATUS_H_
|
||||
#endif //OCEANBASE_OBSERVER_OB_ALL_VIRTUAL_ARCHIVE_DEST_STATUS_H_
|
Loading…
x
Reference in New Issue
Block a user