github-actions[bot] commented on code in PR #31483:
URL: https://github.com/apache/doris/pull/31483#discussion_r1504076409


##########
cloud/src/meta-service/meta_service.cpp:
##########
@@ -1248,6 +1256,28 @@ std::vector<std::pair<int64_t, int64_t>> 
calc_sync_versions(int64_t req_bc_cnt,
     return versions;
 }
 
+static bool try_fetch_and_parse_schema(
+            const std::unique_ptr<Transaction>& txn, RowsetMetaCloudPB& 
rowset_meta,
+            const std::string& key, MetaServiceCode& code, std::string& msg) {
+    ValueBuf val_buf;
+    TxnErrorCode err = cloud::get(txn.get(), key, &val_buf);
+    if (err != TxnErrorCode::TXN_OK) {
+        code = cast_as<ErrCategory::READ>(err);
+        msg = fmt::format("failed to get schema, schema_version={}, 
rowset_version=[{}-{}]: {}",
+                          rowset_meta.schema_version(), 
rowset_meta.start_version(),
+                          rowset_meta.end_version(),
+                          err == TxnErrorCode::TXN_KEY_NOT_FOUND ? "not found" 
: "internal error");
+        return false;
+    }
+    auto schema = rowset_meta.mutable_tablet_schema();
+    if (!parse_schema_value(val_buf, schema)) {
+        code = MetaServiceCode::PROTOBUF_PARSE_ERR;
+        msg = fmt::format("malformed schema value, key={}", key);
+        return false;

Review Comment:
   warning: redundant boolean literal in conditional return statement 
[readability-simplify-boolean-expr]
   
   cloud/src/meta-service/meta_service.cpp:1272:
   ```diff
   -     if (!parse_schema_value(val_buf, schema)) {
   -         code = MetaServiceCode::PROTOBUF_PARSE_ERR;
   -         msg = fmt::format("malformed schema value, key={}", key);
   -         return false;
   -     }
   -     return true;
   +     return static_cast<bool>(parse_schema_value(val_buf, schema));
   ```
   



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