Fix tests

This commit is contained in:
Alexey Milovidov 2021-01-03 19:12:22 +03:00
parent e8e9d0311a
commit 9d5b2023e8
3 changed files with 8 additions and 9 deletions

View File

@ -82,8 +82,6 @@ CheckResults FileChecker::check() const
void FileChecker::repair()
{
initialize();
for (const auto & name_size : map)
{
const String & name = name_size.first;

View File

@ -205,6 +205,7 @@ public:
if (!done)
{
/// Rollback partial writes.
LOG_WARNING(storage.log, "Rollback partial writes");
streams.clear();
storage.file_checker.repair();
}
@ -326,12 +327,12 @@ void TinyLogBlockOutputStream::writeSuffix()
for (auto & pair : streams)
column_files.push_back(storage.files[pair.first].data_file_path);
streams.clear();
done = true;
for (const auto & file : column_files)
storage.file_checker.update(file);
storage.file_checker.save();
streams.clear();
done = true;
}

View File

@ -25,7 +25,7 @@ function test_func()
$CLICKHOUSE_CLIENT --query "SELECT count(), sum(x + y + z) FROM log" > "${CLICKHOUSE_TMP}"/select_result 2>&1;
grep -o -F 'File not found' "${CLICKHOUSE_TMP}"/select_result || cat "${CLICKHOUSE_TMP}"/select_result
cat "${CLICKHOUSE_TMP}"/select_result
[[ $MAX_MEM -gt 200000000 ]] && break;
done
@ -33,9 +33,9 @@ function test_func()
$CLICKHOUSE_CLIENT --query "DROP TABLE log";
}
test_func TinyLog | grep -v -P '^(Memory limit|0\t0|File not found|[1-9]000000\t)'
test_func StripeLog | grep -v -P '^(Memory limit|0\t0|File not found|[1-9]000000\t)'
test_func Log | grep -v -P '^(Memory limit|0\t0|File not found|[1-9]000000\t)'
test_func TinyLog | grep -v -P '^(Memory limit|0\t0|[1-9]000000\t)'
test_func StripeLog | grep -v -P '^(Memory limit|0\t0|[1-9]000000\t)'
test_func Log | grep -v -P '^(Memory limit|0\t0|[1-9]000000\t)'
rm "${CLICKHOUSE_TMP}/insert_result"
rm "${CLICKHOUSE_TMP}/select_result"