Skip to content

Commit

Permalink
Fix for Load job failed JSON exception
Browse files Browse the repository at this point in the history
  • Loading branch information
MikhailBurdukov committed Jul 26, 2024
1 parent fe54cea commit 47a8a71
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Storages/MergeTree/checkDataPart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,13 @@ bool isRetryableException(std::exception_ptr exception_ptr)
{
return true;
}

/// In fact, there can be other similar situations.
/// But it is OK, because there is a safety guard against deleting too many parts.
return false;
catch (...)
{
/// In fact, there can be other similar situations.
/// But it is OK, because there is a safety guard against deleting too many parts.
return false;
}
UNREACHABLE();
}


Expand Down
20 changes: 20 additions & 0 deletions tests/integration/test_restart_server/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,23 @@ def test_flushes_async_insert_queue():
)
node.restart_clickhouse()
assert node.query("SELECT * FROM flush_test") == "world\t23456\n"


def test_serialization_json_broken(start_cluster):
node.query("DROP TABLE IF EXISTS test")

node.query(
"CREATE TABLE test( a int, b Map(String, String)) Engine = MergeTree() order by a"
)
node.query("INSERT INTO test SELECT number, map('aaa', 'bbb') from numbers(10)")

metadata_path = node.query(
"SELECT arrayJoin(data_paths) FROM system.tables WHERE table='test'"
).split("\n")

node.exec_in_container(
["bash", "-c", f"echo '' > {metadata_path[0]}all_1_1_0/serialization.json"]
)
node.restart_clickhouse()

node.query("SELECT 1")

0 comments on commit 47a8a71

Please sign in to comment.