Commit Graph

3 Commits

Author SHA1 Message Date
Alexander Tokmakov
0ba6751849
Update 02380_insert_mv_race.sh 2022-08-08 15:53:37 +03:00
Nikolai Kochetov
cf34232675 Output header is now empty for every MV chain.
Instead of checking that number of processors different for different
threads, simply always return empty header from buildChainImpl(), by
adding explicit conversion.

v2: ignore UNKNOWN_TABLE errors in test
2022-08-05 13:16:32 +03:00
Azat Khuzhin
4efa847a1f Fix LOGICAL_ERROR on race between DROP and INSERT with materialized views
In case of parallel INSERT (max_insert_threads > 1) it is possible for
VIEW to be DROP/DETACH'ed while building pipeline for various paralell
streams, and in this case the header will not match since when you have
VIEW you will got empty header and non-empty header otherwise.

And this leads to LOGICAL_ERROR later, while checking that output
headers are the same (in QueryPipelineBuilder::addChains() -> Pipe::addChains()).

However it also makes the pipeline different for various parallel
streams, and it looks like it is better to fail in this case, so instead
of always returning empty header from buildChainImpl() explicit check
had been added.

Note, that I wasn't able to reproduce the issue with the added test,
but CI may have more "luck" (although I've verified it manually).

Fixes: #35902
Cc: @KochetovNicolai
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-08-05 13:16:32 +03:00