@@ -6787,7 +6787,8 @@ sub check_partman_premake {
67876787 };
67886788 };
67896789
6790-
6790+ # the highest partition boundarie must not be lower than the configured premake
6791+ # if the highest partition boundarie is higher than the configured premake, this is a gap indicator
67916792 $SQL = q{
67926793SELECT
67936794 current_database() as database,
@@ -6818,7 +6819,11 @@ sub check_partman_premake {
68186819ON
68196820 a.parent_table::text = b.parent_table::text
68206821WHERE
6821- b.date - a.date::date > 0
6822+ -- the highest partition boundarie must not be lower than the configured premake
6823+ b.date > a.date::date
6824+ OR
6825+ -- if the highest partition boundarie is higher than the configured premake, this is a gap indicator
6826+ a.date::date - b.date > 100
68226827ORDER BY 3, 2 DESC
68236828} ;
68246829
@@ -6832,14 +6837,19 @@ sub check_partman_premake {
68326837 next ROW if skip_item($dbname );
68336838 $found = 2;
68346839
6835- $msg = " $dbname =$parent_table ($missing_days )" ;
6836- print " $msg " ;
6840+ if ( $missing_days < 0 ){
6841+ $msg = " $dbname =$parent_table ($missing_days ) gap " ;
6842+
6843+ } else {
6844+ $msg = " $dbname =$parent_table ($missing_days ) missing days " ;
6845+ }
6846+ # print "$msg";
68376847 $db -> {perf } .= sprintf ' %s=%sd;%s;%s' ,
68386848 perfname($dbname ), $missing_days , $warning , $critical ;
6839- if (length $critical and $missing_days >= $critical ) {
6849+ if (length $critical and abs( $missing_days ) >= $critical ) {
68406850 push @crit => $msg ;
68416851 }
6842- elsif (length $warning and $missing_days >= $warning ) {
6852+ elsif (length $warning and abs( $missing_days ) >= $warning ) {
68436853 push @warn => $msg ;
68446854 }
68456855 else {
0 commit comments