github-actions[bot] commented on code in PR #69797: URL: https://github.com/apache/doris/pull/69797#discussion_r4408148002
########## regression-test/suites/fault_injection_p0/test_mow_topn_key_prefix_overlapping_segments.groovy: ########## @@ -0,0 +1,116 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// ORDER BY <key prefix> LIMIT n pushed down to the storage layer on a merge-on-write table +// whose rowset has two segments that overlap on keys. The storage TopN merges the segments of +// a rowset by the ORDER BY columns; rows that are equal on them but differ in the rest of the +// key are different rows and must all come back. Before the fix the merge dropped them as +// older versions of one key: ORDER BY k1 LIMIT 10 returned k1 = 0..9 once each instead of +// k1 = 0..4 twice each. +suite("test_mow_topn_key_prefix_overlapping_segments", "nonConcurrent") { + // Run `insertSql` with MemTable.need_flush on, which flushes every Block of 20 rows into its + // own segment: the 40 rows of numbers("number" = "40") become two segments of one rowset. The + // test is void unless the load really wrote an OVERLAPPING rowset with two segments. + def loadTwoOverlappingSegments = { String table, String insertSql -> + try { + GetDebugPoint().enableDebugPointForAllBEs("MemTable.need_flush") + sql "SET batch_size = 20" Review Comment: [P2] Force separate writer batches when constructing the fixture With a single insert task using the legacy tablet sink (for example, cloud mode with `parallel_pipeline_task_num=1`, or local mode with that setting and `enable_memtable_on_sink_node=false`), `batch_size=20` only controls the source blocks. `VNodeChannel::init` floors the RPC batch size at 8192, so `add_block` combines both 20-row blocks into one 40-row write. `MemTable.need_flush` consequently flushes once, creating one segment, and the `hasMergeLayout` assertion fails before any correctness query. Please construct multiple writer-side flushes in a way that also works with the legacy sink. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
