You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "wyxxxcat (via GitHub)" <gi...@apache.org> on 2025/10/13 02:48:18 UTC

[PR] [chore](checker) Add `get_all_tablet_metas` MetaReader skeleton [doris]

wyxxxcat opened a new pull request, #56888:
URL: https://github.com/apache/doris/pull/56888

   ### What problem does this PR solve?
   
   Issue Number: close #xxx
   
   Related PR: #xxx
   
   Problem Summary:
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [ ] Regression test
       - [ ] Unit Test
       - [ ] Manual test (add detailed scripts or steps below)
       - [ ] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [ ] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [ ] Other reason <!-- Add your reason?  -->
   
   - Behavior changed:
       - [ ] No.
       - [ ] Yes. <!-- Explain the behavior change -->
   
   - Does this need documentation?
       - [ ] No.
       - [ ] Yes. <!-- Add document PR link here. eg: https://github.com/apache/doris-website/pull/1214 -->
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
   
   


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [chore](checker) Add `get_all_tablet_ids` for MetaReader skeleton [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #56888:
URL: https://github.com/apache/doris/pull/56888#issuecomment-3400021445

   # Cloud UT Coverage Report
   Increment line coverage `63.16% (12/19)` :tada:
   
   [Increment coverage report](http://coverage.selectdb-in.cc/coverage/5cb1f414c6bf818f5073d2aaac2a4027dc2f3d9f_5cb1f414c6bf818f5073d2aaac2a4027dc2f3d9f_cloud/increment_report/index.html)
   [Complete coverage report](http://coverage.selectdb-in.cc/coverage/5cb1f414c6bf818f5073d2aaac2a4027dc2f3d9f_5cb1f414c6bf818f5073d2aaac2a4027dc2f3d9f_cloud/report/index.html)
   | Category          | Coverage           |
   |-------------------|--------------------|
   | Function Coverage | 83.36% (1638/1965) |
   | Line Coverage     | 67.95% (28943/42596) |
   | Region Coverage   | 68.20% (14266/20918) |
   | Branch Coverage   | 58.46% (7591/12984) |


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [chore](checker) Add `get_all_tablet_metas` for MetaReader skeleton [doris]

Posted by "w41ter (via GitHub)" <gi...@apache.org>.
w41ter commented on code in PR #56888:
URL: https://github.com/apache/doris/pull/56888#discussion_r2425175290


##########
cloud/src/meta-store/meta_reader.cpp:
##########
@@ -675,6 +675,57 @@ TxnErrorCode MetaReader::get_all_tablet_rowset_metas(Transaction* txn, int64_t s
     return TxnErrorCode::TXN_OK;
 }
 
+TxnErrorCode MetaReader::get_all_tablet_metas(std::vector<TabletMetaCloudPB>* tablet_metas,
+                                              bool snapshot) {
+    DCHECK(txn_kv_) << "TxnKv must be set before calling";
+    if (!txn_kv_) {
+        return TxnErrorCode::TXN_INVALID_ARGUMENT;
+    }
+    std::unique_ptr<Transaction> txn;
+    TxnErrorCode err = txn_kv_->create_txn(&txn);
+    if (err != TxnErrorCode::TXN_OK) {
+        return err;
+    }
+    return get_all_tablet_metas(txn.get(), tablet_metas, snapshot);
+}
+
+TxnErrorCode MetaReader::get_all_tablet_metas(Transaction* txn,

Review Comment:
   What will happen if an instance has 1M tablets?



-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [chore](checker) Add `get_all_tablet_metas` for MetaReader skeleton [doris]

Posted by "wyxxxcat (via GitHub)" <gi...@apache.org>.
wyxxxcat commented on PR #56888:
URL: https://github.com/apache/doris/pull/56888#issuecomment-3395692241

   run buildall


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [chore](checker) Add `get_all_tablet_metas` for MetaReader skeleton [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #56888:
URL: https://github.com/apache/doris/pull/56888#issuecomment-3396507955

   # Cloud UT Coverage Report
   Increment line coverage `58.11% (43/74)` :tada:
   
   [Increment coverage report](http://coverage.selectdb-in.cc/coverage/cba867511c0553ac0073291e811f4dd145b857c5_cba867511c0553ac0073291e811f4dd145b857c5_cloud/increment_report/index.html)
   [Complete coverage report](http://coverage.selectdb-in.cc/coverage/cba867511c0553ac0073291e811f4dd145b857c5_cba867511c0553ac0073291e811f4dd145b857c5_cloud/report/index.html)
   | Category          | Coverage           |
   |-------------------|--------------------|
   | Function Coverage | 83.38% (1640/1967) |
   | Line Coverage     | 67.88% (28993/42709) |
   | Region Coverage   | 68.11% (14283/20969) |
   | Branch Coverage   | 58.44% (7607/13016) |


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [chore](checker) Add `get_all_tablet_ids` for MetaReader skeleton [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #56888:
URL: https://github.com/apache/doris/pull/56888#issuecomment-3400284080

   PR approved by at least one committer and no changes requested.


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [chore](checker) Add `get_all_tablet_metas` for MetaReader skeleton [doris]

Posted by "wyxxxcat (via GitHub)" <gi...@apache.org>.
wyxxxcat commented on PR #56888:
URL: https://github.com/apache/doris/pull/56888#issuecomment-3395699175

   run buildall


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [chore](checker) Add `get_all_tablet_metas` for MetaReader skeleton [doris]

Posted by "wyxxxcat (via GitHub)" <gi...@apache.org>.
wyxxxcat commented on PR #56888:
URL: https://github.com/apache/doris/pull/56888#issuecomment-3399985825

   run buildall


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [chore](checker) Add `get_all_tablet_metas` for MetaReader skeleton [doris]

Posted by "w41ter (via GitHub)" <gi...@apache.org>.
w41ter commented on code in PR #56888:
URL: https://github.com/apache/doris/pull/56888#discussion_r2425177494


##########
cloud/src/meta-store/meta_reader.cpp:
##########
@@ -675,6 +675,57 @@ TxnErrorCode MetaReader::get_all_tablet_rowset_metas(Transaction* txn, int64_t s
     return TxnErrorCode::TXN_OK;
 }
 
+TxnErrorCode MetaReader::get_all_tablet_metas(std::vector<TabletMetaCloudPB>* tablet_metas,
+                                              bool snapshot) {
+    DCHECK(txn_kv_) << "TxnKv must be set before calling";
+    if (!txn_kv_) {
+        return TxnErrorCode::TXN_INVALID_ARGUMENT;
+    }
+    std::unique_ptr<Transaction> txn;
+    TxnErrorCode err = txn_kv_->create_txn(&txn);
+    if (err != TxnErrorCode::TXN_OK) {
+        return err;
+    }
+    return get_all_tablet_metas(txn.get(), tablet_metas, snapshot);
+}
+
+TxnErrorCode MetaReader::get_all_tablet_metas(Transaction* txn,

Review Comment:
   How about using the VersionedRangeGetIterator to iterate the keys directly in your code?



-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [chore](checker) Add `get_all_tablet_metas` MetaReader skeleton [doris]

Posted by "Thearas (via GitHub)" <gi...@apache.org>.
Thearas commented on PR #56888:
URL: https://github.com/apache/doris/pull/56888#issuecomment-3395691823

   
   Thank you for your contribution to Apache Doris.
   Don't know what should be done next? See [How to process your PR](https://cwiki.apache.org/confluence/display/DORIS/How+to+process+your+PR).
   
   Please clearly describe your PR:
   1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
   2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
   3. What features were added. Why was this function added?
   4. Which code was refactored and why was this part of the code refactored?
   5. Which functions were optimized and what is the difference before and after the optimization?
       


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [chore](checker) Add `get_all_tablet_ids` for MetaReader skeleton [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #56888:
URL: https://github.com/apache/doris/pull/56888#issuecomment-3400284192

   PR approved by anyone and no changes requested.


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [chore](checker) Add `get_all_tablet_metas` for MetaReader skeleton [doris]

Posted by "wyxxxcat (via GitHub)" <gi...@apache.org>.
wyxxxcat commented on PR #56888:
URL: https://github.com/apache/doris/pull/56888#issuecomment-3396418126

   run buildall


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [chore](checker) Add `get_all_tablet_metas` for MetaReader skeleton [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #56888:
URL: https://github.com/apache/doris/pull/56888#issuecomment-3395736257

   # Cloud UT Coverage Report
   Increment line coverage `0.00% (0/44)` :tada:
   
   [Increment coverage report](http://coverage.selectdb-in.cc/coverage/c8044345dd2533879254f71774898ef0e6a11b6e_c8044345dd2533879254f71774898ef0e6a11b6e_cloud/increment_report/index.html)
   [Complete coverage report](http://coverage.selectdb-in.cc/coverage/c8044345dd2533879254f71774898ef0e6a11b6e_c8044345dd2533879254f71774898ef0e6a11b6e_cloud/report/index.html)
   | Category          | Coverage           |
   |-------------------|--------------------|
   | Function Coverage | 83.29% (1635/1963) |
   | Line Coverage     | 67.83% (28910/42620) |
   | Region Coverage   | 68.05% (14241/20928) |
   | Branch Coverage   | 58.37% (7582/12990) |


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [chore](checker) Add `get_all_tablet_ids` for MetaReader skeleton [doris]

Posted by "gavinchou (via GitHub)" <gi...@apache.org>.
gavinchou merged PR #56888:
URL: https://github.com/apache/doris/pull/56888


-- 
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-unsubscribe@doris.apache.org

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


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