Files
doris/fe
shee ff9811fa1b [Bug][Colocate] when adding a table to the colocate group, we should check that the number of buckets per partition is the same (#21906)
for example

CREATE TABLE `colocate_a` (
 dt date,
 k1 int,
 v1 int
) ENGINE=OLAP
DUPLICATE KEY(`k1`)
PARTITION BY RANGE(`dt`)
(PARTITION p1 VALUES [('2022-10-02'), ('2022-10-03'))
DISTRIBUTED BY HASH(`k1`) BUCKETS 2
PROPERTIES (
"replication_num" = "3",
"in_memory" = "false",
"storage_format" = "V2"
);

ALTER TABLE colocate_a set ("colocate_with" = "ab");

CREATE TABLE `colocate_b` (
 dt date,
 k1 int,
 v1 int
) ENGINE=OLAP
DUPLICATE KEY(`k1`)
PARTITION BY RANGE(`dt`)
(PARTITION p1 VALUES [('2022-10-02'), ('2022-10-03'))
DISTRIBUTED BY HASH(`k1`) BUCKETS 2
PROPERTIES (
"replication_num" = "3",
"in_memory" = "false",
"storage_format" = "V2"
);

ALTER TABLE colocate_b ADD PARTITION p2 VALUES [("2022-10-03"),("2022-10-04")) DISTRIBUTED BY HASH(k1) BUCKETS 10;

ALTER TABLE colocate_b set ("colocate_with" = "ab");
table colocate_b partition p2 set bucket num is 10 then take it into group ab.

In ColocateTableCheckerAndBalancer matchGroup occur :

java.lang.IllegalStateException: 2 vs. 10
303861     at com.google.common.base.Preconditions.checkState(Preconditions.java:508) ~[guava-30.0-jre.jar:?]
303862     at org.apache.doris.clone.ColocateTableCheckerAndBalancer.matchGroup(ColocateTableCheckerAndBalancer.java:242) ~[doris-fe.jar:1.2-SNAPSHOT]
303863     at org.apache.doris.clone.ColocateTableCheckerAndBalancer.runAfterCatalogReady(ColocateTableCheckerAndBalancer.java:95) ~[doris-fe.jar:1.2-SNAPSHOT]
303864     at org.apache.doris.common.util.MasterDaemon.runOneCycle(MasterDaemon.java:58) ~[doris-fe.jar:1.2-SNAPSHOT]
303865     at org.apache.doris.common.util.Daemon.run(Daemon.java:116) ~[doris-fe.jar:1.2-SNAPSHOT]
---------

Co-authored-by: shizhiqiang03 <shizhiqiang03@meituan.com>
2023-07-24 09:01:16 +08:00
..

# 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.

# fe-common

This module is used to store some common classes of other modules.

# spark-dpp

This module is Spark DPP program, used for Spark Load function.
Depends: fe-common

# fe-core

This module is the main process module of FE.
Depends: fe-common, spark-dpp