add warning log when the number of sstable is at high level
This commit is contained in:
@ -134,7 +134,7 @@ int ObITableArray::copy(
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (OB_FAIL(init(allocator, other.count_))) {
|
||||
LOG_ERROR("failed to init ObITableArray for copying", K(ret), K(other));
|
||||
LOG_WARN("failed to init ObITableArray for copying", K(ret), K(other));
|
||||
} else {
|
||||
for (int64_t i = 0; OB_SUCC(ret) && i < count_; ++i) {
|
||||
if (OB_ISNULL(other[i])) {
|
||||
|
||||
@ -2460,10 +2460,21 @@ int ObTablet::get_kept_multi_version_start(
|
||||
ls_min_reserved_snapshot = ls.get_min_reserved_snapshot();
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
const int64_t old_min_reserved_snapshot = min_reserved_snapshot;
|
||||
min_reserved_snapshot = common::min(
|
||||
ls_min_reserved_snapshot,
|
||||
common::min(min_reserved_snapshot, min_medium_snapshot));
|
||||
multi_version_start = MIN(MAX(min_reserved_snapshot, multi_version_start), tablet.get_snapshot_version());
|
||||
|
||||
const int64_t current_time = common::ObTimeUtility::fast_current_time() * 1000; // needs ns here.
|
||||
if (current_time - multi_version_start > 120 * 60 * 1000 * 1000L /*2 hour*/) {
|
||||
if (REACH_TENANT_TIME_INTERVAL(10 * 1000 * 1000L /*10s*/)) {
|
||||
LOG_INFO("tablet multi version start not advance for a long time", K(ret),
|
||||
"ls_id", tablet.get_tablet_meta().ls_id_, K(tablet_id),
|
||||
K(multi_version_start), K(old_min_reserved_snapshot), K(min_medium_snapshot),
|
||||
"ls_min_reserved_snapshot", ls.get_min_reserved_snapshot(), K(tablet));
|
||||
}
|
||||
}
|
||||
}
|
||||
LOG_DEBUG("get multi version start", "ls_id", tablet.get_tablet_meta().ls_id_, K(tablet_id),
|
||||
K(multi_version_start), K(min_reserved_snapshot), K(tablet.get_tablet_meta()), K(min_medium_snapshot),
|
||||
|
||||
@ -1255,6 +1255,14 @@ int ObTabletTableStore::check_ready_for_read()
|
||||
is_ready_for_read_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret) && get_table_count() > EMERGENCY_SSTABLE_CNT) {
|
||||
int tmp_ret = OB_TOO_MANY_SSTABLE;
|
||||
LOG_WARN("Emergency SSTable count, maybe frequency freeze occurs, or maybe multi_version_start not adavanced.",
|
||||
K(tmp_ret),
|
||||
"major table count: ", major_tables_.count(),
|
||||
"minor table count: ", minor_tables_.count());
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -236,6 +236,7 @@ private:
|
||||
public:
|
||||
static const int64_t TABLE_STORE_VERSION = 0x0100;
|
||||
static const int64_t MAX_SSTABLE_CNT = 128;
|
||||
static const int64_t EMERGENCY_SSTABLE_CNT = 48;
|
||||
private:
|
||||
ObTablet *tablet_ptr_;
|
||||
ObSSTableArray major_tables_;
|
||||
|
||||
Reference in New Issue
Block a user