Skip to content

Commit

Permalink
Add max-records argument to rt-validator
Browse files Browse the repository at this point in the history
When run for an RT database with a large number of records that need to be
fixed, rt-validator can use large amounts of memory. On systems with less memory
this can cause oom errors.

Added a max-records argument to help lower memory usage.
  • Loading branch information
bkembreeBPS committed Jan 6, 2025
1 parent d56c859 commit 877f332
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sbin/rt-validator.in
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ Init(
'verbose|v',
'links-only',
'cgm-only',
'max-records=i',
'quiet',
);

Expand Down Expand Up @@ -1410,6 +1411,10 @@ sub check_integrity {

my $res = 1;

if ( $opt{'max-records'} ) {
$query .= " limit $opt{'max-records'}";
}

my $sth = execute_query( $query, @binds );
while ( my ($sid, @set) = $sth->fetchrow_array ) {
$res = 0;
Expand Down

0 comments on commit 877f332

Please sign in to comment.