Skip to content

Commit

Permalink
increase and fix log
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasgameiroborges committed Sep 5, 2024
1 parent 3716775 commit 761b33f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,12 @@ def _check_pgdata_storage_size(self) -> None:
logger.error("pgdata folder not found in %s", self.pgdata_path)
return

logger.debug("pgdata free disk space: %s out of %s", free_size, total_size)
logger.debug(
"pgdata free disk space: %s out of %s, ratio of %s",
free_size,
total_size,
free_size / total_size,
)
if free_size / total_size < 0.1:
self.unit.status = BlockedStatus(INSUFFICIENT_SIZE_WARNING)
elif self.unit.status.message == INSUFFICIENT_SIZE_WARNING:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async def test_filling_and_emptying_pgdata_storage(ops_test: OpsTest):
connection.autocommit = True
with connection.cursor() as cursor:
cursor.execute("CREATE TABLE big_table (testcol INT);")
cursor.execute("INSERT INTO big_table SELECT generate_series(1,400000000);")
cursor.execute("INSERT INTO big_table SELECT generate_series(1,600000000);")
connection.close()

async with ops_test.fast_forward():
Expand Down

0 comments on commit 761b33f

Please sign in to comment.