Commit b1394126 authored by Barry Perlman's avatar Barry Perlman Committed by Yoni Fogel

Addresses #1697 Incorrect value was used to set new file size

in logic that shrinks files (to free disk space) when possible.

git-svn-id: file:///svn/toku/tokudb@11340 c7de825b-a66e-492c-adef-691d508d4ae1
parent adc52bb7
......@@ -81,7 +81,7 @@ toku_maybe_truncate_cachefile (CACHEFILE cf, u_int64_t size_used)
assert(file_size >= 0);
}
if ((u_int64_t)file_size >= size_used + (2*FILE_CHANGE_INCREMENT)) {
toku_off_t new_size = alignup(file_size, (2*FILE_CHANGE_INCREMENT)); //Truncate to new size_used.
toku_off_t new_size = alignup(size_used, (2*FILE_CHANGE_INCREMENT)); //Truncate to new size_used.
assert(new_size < file_size);
int r = toku_cachefile_truncate(cf, new_size);
assert(r==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