Co-authored-by: kisshot288 <59246842+kisshot288@users.noreply.github.com>
This commit is contained in:
parent
e4e493480b
commit
b3fa782058
|
|
@ -1307,6 +1307,11 @@ public class Config extends ConfigBase {
|
|||
public static long check_consistency_default_timeout_second = 600; // 10 min
|
||||
@ConfField(mutable = true)
|
||||
public static long consistency_tablet_meta_check_interval_ms = 2 * 3600 * 1000L; // every 2 hours
|
||||
/**
|
||||
* tablet can be checked only one time on one day, to avoid too many disk io in be
|
||||
*/
|
||||
@ConfField(mutable = true)
|
||||
public static long consistency_check_cooldown_time_second = 24 * 3600L; // every 1 day
|
||||
|
||||
// Configurations for query engine
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -525,7 +525,12 @@ public class ConsistencyChecker extends FrontendDaemon {
|
|||
// sort tablets
|
||||
Queue<MetaObject> tabletQueue =
|
||||
new PriorityQueue<>(Math.max(index.getTablets().size(), 1), COMPARATOR);
|
||||
tabletQueue.addAll(index.getTablets());
|
||||
long startCheckTime = System.currentTimeMillis();
|
||||
long cooldownedTimeMs = startCheckTime - Config.consistency_check_cooldown_time_second * 1000;
|
||||
List<Tablet> cooldownedTablets = index.getTablets().stream()
|
||||
.filter(t -> t.getLastCheckTime() < cooldownedTimeMs)
|
||||
.toList();
|
||||
tabletQueue.addAll(cooldownedTablets);
|
||||
|
||||
while ((chosenOne = tabletQueue.poll()) != null) {
|
||||
LocalTablet tablet = (LocalTablet) chosenOne;
|
||||
|
|
|
|||
Loading…
Reference in New Issue