Adjust weak read timestamp validation

This commit is contained in:
obdev
2023-05-16 08:47:35 +00:00
committed by ob-robot
parent 51b2ce63be
commit 2b7b728148
12 changed files with 87 additions and 62 deletions

View File

@ -1183,11 +1183,12 @@ int ObSqlTransControl::check_ls_readable(const uint64_t tenant_id,
can_read = false;
if (!ls_id.is_valid()
|| !addr.is_valid()
|| max_stale_time_us <= 0) {
|| !addr.is_valid()) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid argument", K(ls_id), K(addr), K(max_stale_time_us));
} else if (-1 == max_stale_time_us) {
// no need check
can_read = true;
} else if (observer::ObServer::get_instance().get_self() == addr) {
storage::ObLSService *ls_svr = MTL(storage::ObLSService *);
storage::ObLSHandle handle;
@ -1201,16 +1202,12 @@ int ObSqlTransControl::check_ls_readable(const uint64_t tenant_id,
} else if (OB_ISNULL(ls = handle.get_ls())) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("id service log stream not exist");
} else {
can_read = true;
}
/*
} else if (ObTimeUtility::current_time() - max_stale_time_us
< ls->get_ls_wrs_handler()->get_ls_weak_read_ts().convert_to_ts()) {
can_read = true;
} else if (REACH_TIME_INTERVAL(10 * 1000 * 1000)) {
LOG_WARN("log stream unreadable", K(ls_id), K(addr), K(max_stale_time_us));
}*/
}
} else {
LOG_TRACE("log stream is not local", K(ls_id), K(addr));
}