Skip to content

Commit

Permalink
Show DB usage as part of DB status in cf-check diagnose
Browse files Browse the repository at this point in the history
Plus the information if we think the DB needs rotation or
not. Almost full LMDBs are problematic and should be moved out of
the way.

Ticket: none
Changelog: `cf-check diagnose` now shows DB usage and a hint if
           rotation is required
  • Loading branch information
vpodzime committed Nov 20, 2023
1 parent 5ed5585 commit 6141736
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions cf-check/diagnose.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,18 +614,26 @@ size_t diagnose_files(

if (symlink_target != NULL)
{
int usage;
bool needs_rotation = lmdb_file_needs_rotation(symlink_target, &usage);
Log(LOG_LEVEL_INFO,
"Status of '%s' -> '%s': %s\n",
"Status of '%s' -> '%s': %s [%d%% usage%s]\n",
symlink,
symlink_target,
CF_CHECK_STRING(r));
CF_CHECK_STRING(r),
usage,
needs_rotation ? ", needs rotation" : "");
}
else
{
int usage;
bool needs_rotation = lmdb_file_needs_rotation(filename, &usage);
Log(LOG_LEVEL_INFO,
"Status of '%s': %s\n",
"Status of '%s': %s [%d%% usage%s]\n",
filename,
CF_CHECK_STRING(r));
CF_CHECK_STRING(r),
usage,
needs_rotation ? ", needs rotation" : "");
}


Expand Down

0 comments on commit 6141736

Please sign in to comment.