Commit 4a3401e9 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

Fix at least one problem found by the loader-cleanup-test. Make the valgrind...

Fix at least one problem found by the loader-cleanup-test.  Make the valgrind version of loader-cleanup-test use {{{-r 1000}}} so it runs faster.  Refs #2642. [t:2642]

git-svn-id: file:///svn/toku/tokudb@20482 c7de825b-a66e-492c-adef-691d508d4ae1
parent 25d02e40
...@@ -1724,9 +1724,10 @@ int merge_files (struct merge_fileset *fs, ...@@ -1724,9 +1724,10 @@ int merge_files (struct merge_fileset *fs,
} }
for (int i=0; i<n_to_merge; i++) { for (int i=0; i<n_to_merge; i++) {
int idx = fs->n_temp_files -1 -i; int idx = fs->n_temp_files -1 -i;
data_fidxs[i] = fs->data_fidxs[idx]; FIDX fidx = fs->data_fidxs[idx];
result = brtloader_fi_reopen(&bl->file_infos, data_fidxs[i], "r"); result = brtloader_fi_reopen(&bl->file_infos, fidx, "r");
if (result) { printf("%s:%d r=%d\n", __FILE__, __LINE__, result); break; } if (result) break;
data_fidxs[i] = fidx;
} }
if (result==0 && !to_queue) { if (result==0 && !to_queue) {
result = extend_fileset(bl, &next_file_set, &merged_data); result = extend_fileset(bl, &next_file_set, &merged_data);
...@@ -1777,6 +1778,7 @@ int merge_files (struct merge_fileset *fs, ...@@ -1777,6 +1778,7 @@ int merge_files (struct merge_fileset *fs,
if (result!=0) break; if (result!=0) break;
} }
if (result) brt_loader_set_panic(bl, result);
{ {
int r = queue_eof(output_q); int r = queue_eof(output_q);
if (r!=0 && result==0) result = r; if (r!=0 && result==0) result = r;
......
...@@ -673,3 +673,12 @@ loader-dup-test4.tdbrun: loader-dup-test.tdb$(BINSUF) ...@@ -673,3 +673,12 @@ loader-dup-test4.tdbrun: loader-dup-test.tdb$(BINSUF)
loader-dup-test5.tdbrun: loader-dup-test.tdb$(BINSUF) loader-dup-test5.tdbrun: loader-dup-test.tdb$(BINSUF)
$(VGRIND) ./loader-dup-test.tdb -d 1 -s -r 1000 -E -e 5 $(SUMMARIZE_CMD) $(VGRIND) ./loader-dup-test.tdb -d 1 -s -r 1000 -E -e 5 $(SUMMARIZE_CMD)
loader-cleanup-test.tdbrun: $(patsubst %,loader-cleanup-test%.tdbrun, 1)
true $(SUMMARIZE_CMD) #State that this has passed.
## Cannot run loader-cleanup-test parallel till we fix #2645.
#loader-cleanup-test0.tdbrun: loader-cleanup-test.tdb$(BINSUF)
# ./loader-cleanup-test.tdb $(SUMMARIZE_CMD)
loader-cleanup-test1.tdbrun: loader-cleanup-test.tdb$(BINSUF)
$(VGRIND) ./loader-cleanup-test.tdb -r 1000 $(SUMMARIZE_CMD)
...@@ -606,10 +606,9 @@ static void test_loader(enum test_type t, DB **dbs, int trigger) ...@@ -606,10 +606,9 @@ static void test_loader(enum test_type t, DB **dbs, int trigger)
poll_count=0; poll_count=0;
int n = count_temp(env->i->real_data_dir); // You cannot count the temp files here.
if (verbose) { if (verbose) {
printf("Data dir is %s\n", env->i->real_data_dir); printf("Data dir is %s\n", env->i->real_data_dir);
printf("Num temp files = %d\n", n);
} }
if (t == commit || t == abort_txn) { if (t == commit || t == abort_txn) {
// close the loader // close the loader
...@@ -621,10 +620,7 @@ static void test_loader(enum test_type t, DB **dbs, int trigger) ...@@ -621,10 +620,7 @@ static void test_loader(enum test_type t, DB **dbs, int trigger)
CKERR(r); CKERR(r);
if (!USE_PUTS) { if (!USE_PUTS) {
assert(poll_count>0); assert(poll_count>0);
if (assert_temp_files && n == 0) { // You cannot count temp files here
printf("Test is not complete if no temp files are created.\n");
assert(0);
}
} }
} }
else if (t == abort_via_poll) { else if (t == abort_via_poll) {
...@@ -660,7 +656,7 @@ static void test_loader(enum test_type t, DB **dbs, int trigger) ...@@ -660,7 +656,7 @@ static void test_loader(enum test_type t, DB **dbs, int trigger)
r = loader->abort(loader); r = loader->abort(loader);
CKERR(r); CKERR(r);
} }
n = count_temp(env->i->real_data_dir); int n = count_temp(env->i->real_data_dir);
if (verbose) printf("Num temp files = %d\n", n); if (verbose) printf("Num temp files = %d\n", n);
fflush(stdout); fflush(stdout);
assert(n==0); assert(n==0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment