trikker opened a new issue, #27610:
URL: https://github.com/apache/doris/issues/27610

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   2.0.2
   
   ### What's Wrong?
   
   When creating a table without the tag.location.default property value, it 
will not inherit the tag.location.default value in database properties.
   
   ### What You Expected?
   
   When creating a table without the tag.location.default property value, it 
should inherit the tag.location.default value in database properties.
   
   ### How to Reproduce?
   
   1. There is only one backend in out environment
   
   ```
   'root'@(none) Mon Nov 27 14:33:24 2023>show backends;
   
+-----------+----------------+---------------+--------+----------+----------+---------------------+---------------------+-------+----------------------+-----------+------------------+--------------------+---------------+---------------+---------+----------------+--------------------+--------------------------+--------+--------------------------+-------------------------------------------------------------------------------------------------------------------------------+-------------------------+----------+
   | BackendId | Host           | HeartbeatPort | BePort | HttpPort | BrpcPort 
| LastStartTime       | LastHeartbeat       | Alive | SystemDecommissioned | 
TabletNum | DataUsedCapacity | TrashUsedCapcacity | AvailCapacity | 
TotalCapacity | UsedPct | MaxDiskUsedPct | RemoteUsedCapacity | Tag             
         | ErrMsg | Version                  | Status                           
                                                                                
             | HeartbeatFailureCounter | NodeRole |
   
+-----------+----------------+---------------+--------+----------+----------+---------------------+---------------------+-------+----------------------+-----------+------------------+--------------------+---------------+---------------+---------+----------------+--------------------+--------------------------+--------+--------------------------+-------------------------------------------------------------------------------------------------------------------------------+-------------------------+----------+
   | 11147     | xx.xx.xx.xx | 9050          | 9060   | 8040     | 8060     | 
2023-11-24 17:25:43 | 2023-11-27 14:33:26 | true  | false                | 
13163     | 105.510 GB       | 174.255 KB         | 1.121 TB      | 2.181 TB    
  | 48.60 % | 48.60 %        | 0.000              | {"location" : "default"} |  
      | doris-2.0.2-rc05-ae923f7 | {"lastSuccessReportTabletsTime":"2023-11-27 
14:32:39","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
 | 0                       | mix      |
   
+-----------+----------------+---------------+--------+----------+----------+---------------------+---------------------+-------+----------------------+-----------+------------------+--------------------+---------------+---------------+---------+----------------+--------------------+--------------------------+--------+--------------------------+-------------------------------------------------------------------------------------------------------------------------------+-------------------------+----------+
   1 row in set (0.00 sec)
   
   ```
   
   2. create a database with property  "replication_allocation" = 
"tag.location.default: 1"
   
   ```
   'root'@(none) Mon Nov 27 14:24:43 2023>create database mytestdb PROPERTIES  
("replication_allocation" = "tag.location.default: 1");
   Query OK, 0 rows affected (0.00 sec)
   
   'root'@mytestdb Mon Nov 27 14:25:56 2023>show create database mytestdb\G
   *************************** 1. row ***************************
          Database: mytestdb
   Create Database: CREATE DATABASE `mytestdb`
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1"
   )
   1 row in set (0.00 sec)
   
   ```
   
   3. create a table in mytestdb without property  "replication_allocation" = 
"tag.location.default: 1" and it will fail
   
   ```
   'root'@mytestdb Mon Nov 27 14:25:30 2023>CREATE TABLE `t` (
       ->   `id` int(11) NULL,
       ->   `name` varchar(60) NULL
       -> ) ENGINE=OLAP
       -> UNIQUE KEY(`id`)
       -> COMMENT 'OLAP'
       -> DISTRIBUTED BY HASH(`id`) BUCKETS AUTO;
   ERROR 1105 (HY000): errCode = 2, detailMessage = replication num should be 
less than the number of available backends. replication num is 3, available 
backend num is 1
   
   ```
   
   ### Anything Else?
   
   Error in fe.warn.log:
   
   ```
   2023-11-27 14:25:56,574 WARN (mysql-nio-pool-710|28950) 
[StmtExecutor.handleDdlStmt():2193] DDL statement(CREATE TABLE `t` (
     `id` int(11) NULL,
     `name` varchar(60) NULL
   ) ENGINE=OLAP
   UNIQUE KEY(`id`)
   COMMENT 'OLAP'
   DISTRIBUTED BY HASH(`id`) BUCKETS AUTO) process failed.
   org.apache.doris.common.DdlException: errCode = 2, detailMessage = 
replication num should be less than the number of available backends. 
replication num is 3, available backend num is 1
           at 
org.apache.doris.system.SystemInfoService.selectBackendIdsForReplicaCreation(SystemInfoService.java:548)
 ~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.datasource.InternalCatalog.createTablets(InternalCatalog.java:2759)
 ~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.datasource.InternalCatalog.createPartitionWithIndices(InternalCatalog.java:1851)
 ~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.datasource.InternalCatalog.createOlapTable(InternalCatalog.java:2428)
 ~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.datasource.InternalCatalog.createTable(InternalCatalog.java:1101)
 ~[doris-fe.jar:1.2-SNAPSHOT]
           at org.apache.doris.catalog.Env.createTable(Env.java:2774) 
~[doris-fe.jar:1.2-SNAPSHOT]
           at org.apache.doris.qe.DdlExecutor.execute(DdlExecutor.java:152) 
~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.qe.StmtExecutor.handleDdlStmt(StmtExecutor.java:2184) 
~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.qe.StmtExecutor.executeByLegacy(StmtExecutor.java:749) 
~[doris-fe.jar:1.2-SNAPSHOT]
           at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:451) 
~[doris-fe.jar:1.2-SNAPSHOT]
           at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:422) 
~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:435) 
~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.qe.ConnectProcessor.dispatch(ConnectProcessor.java:583) 
~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.qe.ConnectProcessor.processOnce(ConnectProcessor.java:834) 
~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.mysql.ReadListener.lambda$handleEvent$0(ReadListener.java:52) 
~[doris-fe.jar:1.2-SNAPSHOT]
           at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 
~[?:?]
           at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) 
~[?:?]
           at java.lang.Thread.run(Thread.java:829) ~[?:?]
   
   ```
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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]

Reply via email to