Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

content-sqlite: misc cleanup #6220

Merged
merged 4 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/modules/content-sqlite/content-sqlite.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <unistd.h>
#include <sys/statvfs.h>
#include <sqlite3.h>
#include <lz4.h>
Expand Down Expand Up @@ -841,7 +840,6 @@ int mod_main (flux_t *h, int argc, char **argv)
flux_log_error (h, "content_sqlite_create failed");
return -1;
}
// override pragmas set above
if (process_args (ctx, argc, argv, &truncate) < 0)
goto done;
if (content_sqlite_opendb (ctx, truncate) < 0)
Expand Down
33 changes: 12 additions & 21 deletions t/t0090-content-enospc.t
Original file line number Diff line number Diff line change
Expand Up @@ -22,49 +22,40 @@ test_expect_success 'create script to fill statedir' '
chmod +x fillstatedir.sh
'

test_expect_success 'clear & setup test statedir' '
rm -rf /test/tmpfs-1m/* &&
mkdir /test/tmpfs-1m/statedir
'

# flux start will fail b/c rc3 will fail due to ENOSPC
test_expect_success 'flux still operates with content-sqlite running out of space' '
rm -rf /test/tmpfs-1m/* &&
mkdir /test/tmpfs-1m/statedir &&
test_must_fail flux start \
-o,-Scontent.backing-module=content-sqlite \
-o,-Sstatedir=/test/tmpfs-1m/statedir \
"./fillstatedir.sh; flux dmesg; flux run echo helloworld" > sql.out 2> sql.err &&
grep -q "No space left on device" sql.out &&
grep "helloworld" sql.out
'

test_expect_success 'clear & setup test statedir' '
rm -rf /test/tmpfs-1m/* &&
mkdir /test/tmpfs-1m/statedir
grep -q "No space left on device" sql.out &&
grep "helloworld" sql.out
'

# flux start will fail b/c rc3 will fail due to ENOSPC
test_expect_success 'flux still operates with content-files running out of space' '
rm -rf /test/tmpfs-1m/* &&
mkdir /test/tmpfs-1m/statedir &&
test_must_fail flux start \
-o,-Scontent.backing-module=content-files \
-o,-Sstatedir=/test/tmpfs-1m/statedir \
"./fillstatedir.sh; flux dmesg; flux run echo helloworld" > files.out 2> files.err &&
grep -q "No space left on device" files.out &&
grep "helloworld" files.out
'

test_expect_success 'clear & setup test statedir' '
rm -rf /test/tmpfs-1m/* &&
mkdir /test/tmpfs-1m/statedir
grep -q "No space left on device" files.out &&
grep "helloworld" files.out
'

# flux start will fail b/c rc3 will fail due to ENOSPC
test_expect_success 'content flush returns error on ENOSPC' '
rm -rf /test/tmpfs-1m/* &&
mkdir /test/tmpfs-1m/statedir &&
test_must_fail flux start \
-o,-Scontent.backing-module=content-sqlite \
-o,-Sstatedir=/test/tmpfs-1m/statedir \
"./fillstatedir.sh; flux dmesg; flux content flush" > flush.out 2> flush.err &&
grep -q "No space left on device" flush.out &&
grep "content.flush: No space left on device" flush.err
grep -q "No space left on device" flush.out &&
grep "content.flush: No space left on device" flush.err
'

test_done
Loading