acelyc111 commented on a change in pull request #3339: [tablet] A small
refactor on class Tablet
URL: https://github.com/apache/incubator-doris/pull/3339#discussion_r409997530
##########
File path: be/src/olap/rowset_graph.cpp
##########
@@ -237,25 +232,26 @@ OLAPStatus
RowsetGraph::capture_consistent_versions(const Version& spec_version,
reversed_path.push_back(tmp_vertex_index);
}
- // Make version_path from reversed_path.
- std::stringstream shortest_path_for_debug;
- for (size_t path_id = reversed_path.size() - 1; path_id > 0; --path_id) {
- int64_t tmp_start_vertex_value =
_version_graph[reversed_path[path_id]].value;
- int64_t tmp_end_vertex_value = _version_graph[reversed_path[path_id -
1]].value;
-
- // tmp_start_vertex_value mustn't be equal to tmp_end_vertex_value
- if (tmp_start_vertex_value <= tmp_end_vertex_value) {
- version_path->emplace_back(tmp_start_vertex_value,
tmp_end_vertex_value - 1);
- } else {
- version_path->emplace_back(tmp_end_vertex_value,
tmp_start_vertex_value - 1);
- }
+ if (version_path != nullptr) {
Review comment:
I found `RowsetGraph::capture_consistent_versions` is now only called by
`Tablet::capture_consistent_versions`, the latter is now called by two
purposes. First, check version integrity, second, check version integrity and
then capture versions when check success. For the first purpose, it's not
needed to construct and fill a output parameter. Of course the function name
`capture_consistent_versions ` maybe not accuracy in this case.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]