test_dictionaries_dependency_xml: decrease dictionaries lifetime

Since ExternalLoader::PeriodicUpdater::check_period_sec = 5, and so if
it will be scheduled too early the reload will be skipped, and indeed
this is what you can see in logs [1], the reload is done each 10
seconds, not 5:

    2021.01.31 14:20:22.590999 [ 48 ] {} <Trace> ExternalDictionariesLoader: Supposed update time for 'dep_x' is 2021-01-31 14:20:27 (loaded, lifetime [5, 5], no errors)
    2021.01.31 14:20:22.591016 [ 48 ] {} <Trace> ExternalDictionariesLoader: Next update time for 'dep_x' was set to 2021-01-31 14:20:27
    ...
    2021.01.31 14:20:32.164882 [ 50 ] {} <Trace> ExternalDictionariesLoader: Start loading object 'dep_x'

  [1]: https://clickhouse-test-reports.s3.yandex.net/19584/37797fdf5b30dc97147e73b3ac8ca9025b80aaed/integration_tests_(release).html#fail1
This commit is contained in:
Azat Khuzhin 2021-02-02 10:47:26 +03:00
parent 9427d5d94b
commit 3d3d6777d3
4 changed files with 7 additions and 4 deletions

View File

@ -11,7 +11,8 @@
<table>dep_z</table>
</clickhouse>
</source>
<lifetime>5</lifetime>
<!-- ExternalLoader::PeriodicUpdater::check_period_sec=5 anyway -->
<lifetime>4</lifetime>
<layout>
<flat/>
</layout>

View File

@ -11,7 +11,8 @@
<table>elements</table>
</clickhouse>
</source>
<lifetime>5</lifetime>
<!-- ExternalLoader::PeriodicUpdater::check_period_sec=5 anyway -->
<lifetime>4</lifetime>
<layout>
<flat/>
</layout>

View File

@ -12,7 +12,8 @@
<invalidate_query>SELECT intDiv(count(), 5) from dict.dep_y</invalidate_query>
</clickhouse>
</source>
<lifetime>5</lifetime>
<!-- ExternalLoader::PeriodicUpdater::check_period_sec=5 anyway -->
<lifetime>4</lifetime>
<layout>
<flat/>
</layout>

View File

@ -65,7 +65,7 @@ def test_get_data(started_cluster):
assert query("SELECT dictGetString('dep_y', 'a', toUInt64(3))") == "fire\n"
assert query("SELECT dictGetString('dep_z', 'a', toUInt64(3))") == "ZZ\n"
# dep_x and dep_z are updated only when there `intDiv(count(), 4)` is changed.
# dep_x and dep_z are updated only when there `intDiv(count(), 5)` is changed.
query("INSERT INTO test.elements VALUES (4, 'ether', 404, 0.001)")
assert_eq_with_retry(instance, "SELECT dictHas('dep_x', toUInt64(4))", "1", sleep_time=2, retry_count=10)
assert query("SELECT dictGetString('dep_x', 'a', toUInt64(3))") == "fire\n"