chaoyli commented on a change in pull request #1037: Set next rowset id to max
id when clone
URL: https://github.com/apache/incubator-doris/pull/1037#discussion_r278786104
##########
File path: be/src/olap/snapshot_manager.cpp
##########
@@ -155,6 +155,24 @@ OLAPStatus SnapshotManager::convert_rowset_ids(DataDir&
data_dir, const string&
new_tablet_meta_pb.set_schema_hash(schema_hash);
TabletSchema tablet_schema;
RETURN_NOT_OK(tablet_schema.init_from_pb(new_tablet_meta_pb.schema()));
+
+ RowsetId max_rowset_id = 0;
+ for (auto& visible_rowset : cloned_tablet_meta_pb.rs_metas()) {
+ if (visible_rowset.rowset_id() > max_rowset_id) {
+ max_rowset_id = visible_rowset.rowset_id();
+ }
+ }
+
+ for (auto& inc_rowset : cloned_tablet_meta_pb.inc_rs_metas()) {
+ if (inc_rowset.rowset_id() > max_rowset_id) {
+ max_rowset_id = inc_rowset.rowset_id();
+ }
+ }
+ OLAPStatus set_id_st = data_dir.set_next_id(max_rowset_id);
Review comment:
RETURN_NOT_OK(data_dir.set_next_id(max_rowset_id));
----------------------------------------------------------------
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]