924060929 commented on code in PR #42680:
URL: https://github.com/apache/doris/pull/42680#discussion_r1837447860


##########
be/src/olap/delta_writer_v2.cpp:
##########
@@ -125,6 +125,9 @@ Status DeltaWriterV2::init() {
     context.partial_update_info = _partial_update_info;
     context.memtable_on_sink_support_index_v2 = true;
 
+    auto tablet = 
DORIS_TRY(ExecEnv::GetInstance()->storage_engine().get_tablet(_req.tablet_id));

Review Comment:
   I meet this exception when I insert rows into olap table if the tablet not 
exist in backend of the instance:
   
   
   ```sql
   CREATE TABLE `a4` (
     `date_time` date NULL
   ) ENGINE=OLAP
   DUPLICATE KEY(`date_time`)
   PARTITION BY RANGE(`date_time`)
   (PARTITION p1 VALUES [('0000-01-01'), ('2020-01-02')),
   PARTITION p2 VALUES [('2020-01-02'), ('2020-01-03')),
   PARTITION p3 VALUES [('2020-01-03'), ('2020-01-04')))
   DISTRIBUTED BY HASH(`date_time`) BUCKETS 1
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1",
   "min_load_replica_num" = "-1",
   "is_being_synced" = "false",
   "storage_medium" = "hdd",
   "storage_format" = "V2",
   "inverted_index_storage_format" = "V2",
   "light_schema_change" = "true",
   "disable_auto_compaction" = "false",
   "enable_single_replica_compaction" = "false",
   "group_commit_interval_ms" = "10000",
   "group_commit_data_bytes" = "134217728"
   );
   
   MySQL root@127.0.0.1:test2> insert into a4 values('2020-01-03');
   Query OK, 1 row affected
   Time: 0.062s
   MySQL root@127.0.0.1:test2> insert into a4 values('2020-01-03');
   (1105, 'errCode = 2, detailMessage = (192.168.126.3)[INTERNAL_ERROR]failed 
to get tablet: 180160, reason: tablet does not exist. 192.168.126.3')
   MySQL root@127.0.0.1:test2> insert into a4 values('2020-01-03');
   Query OK, 1 row affected
   Time: 0.050s
   MySQL root@127.0.0.1:test2> insert into a4 values('2020-01-03');
   (1105, 'errCode = 2, detailMessage = (192.168.126.3)[INTERNAL_ERROR]failed 
to get tablet: 180160, reason: tablet does not exist. 192.168.126.3')
   MySQL root@127.0.0.1:test2> insert into a4 values('2020-01-03');
   Query OK, 1 row affected
   Time: 0.051s
   MySQL root@127.0.0.1:test2> insert into a4 values('2020-01-03');
   (1105, 'errCode = 2, detailMessage = (192.168.126.3)[INTERNAL_ERROR]failed 
to get tablet: 180160, reason: tablet does not exist. 192.168.126.3')
   ```
   for the above sql, I have 2 backends in doris(192.168.126.2 and 
192.168.126.3), and create `a4` with one tablet(exists in 192.168.126.2), the 
insert statement will select a random backend to execute. when the backend of 
the instance not contains the tablets of `a4`,  you will meet the exception
   



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to