From 8a5c4a4972b6c2bb7fcf1af6d34d25c0128792aa Mon Sep 17 00:00:00 2001 From: chrislu Date: Tue, 12 Aug 2025 09:14:16 -0700 Subject: [PATCH] add generation to TaskSource --- weed/pb/worker.proto | 1 + weed/pb/worker_pb/worker.pb.go | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/weed/pb/worker.proto b/weed/pb/worker.proto index b3d0047f2..39e3a6fc8 100644 --- a/weed/pb/worker.proto +++ b/weed/pb/worker.proto @@ -142,6 +142,7 @@ message TaskSource { uint32 volume_id = 5; // Volume ID (for volume operations) repeated uint32 shard_ids = 6; // Shard IDs (for EC shard operations) uint64 estimated_size = 7; // Estimated size to be processed + uint32 generation = 8; // Generation number (for EC operations) } // TaskTarget represents a unified target location for any task type diff --git a/weed/pb/worker_pb/worker.pb.go b/weed/pb/worker_pb/worker.pb.go index 3cc0adab9..118dc08c2 100644 --- a/weed/pb/worker_pb/worker.pb.go +++ b/weed/pb/worker_pb/worker.pb.go @@ -1155,6 +1155,7 @@ type TaskSource struct { VolumeId uint32 `protobuf:"varint,5,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` // Volume ID (for volume operations) ShardIds []uint32 `protobuf:"varint,6,rep,packed,name=shard_ids,json=shardIds,proto3" json:"shard_ids,omitempty"` // Shard IDs (for EC shard operations) EstimatedSize uint64 `protobuf:"varint,7,opt,name=estimated_size,json=estimatedSize,proto3" json:"estimated_size,omitempty"` // Estimated size to be processed + Generation uint32 `protobuf:"varint,8,opt,name=generation,proto3" json:"generation,omitempty"` // Generation number (for EC operations) unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1238,6 +1239,13 @@ func (x *TaskSource) GetEstimatedSize() uint64 { return 0 } +func (x *TaskSource) GetGeneration() uint32 { + if x != nil { + return x.Generation + } + return 0 +} + // TaskTarget represents a unified target location for any task type type TaskTarget struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -3291,7 +3299,7 @@ const file_worker_proto_rawDesc = "" + "\vworking_dir\x18\x04 \x01(\tR\n" + "workingDir\x12#\n" + "\rmaster_client\x18\x05 \x01(\tR\fmasterClient\x12%\n" + - "\x0ecleanup_source\x18\x06 \x01(\bR\rcleanupSource\"\xcf\x01\n" + + "\x0ecleanup_source\x18\x06 \x01(\bR\rcleanupSource\"\xef\x01\n" + "\n" + "TaskSource\x12\x12\n" + "\x04node\x18\x01 \x01(\tR\x04node\x12\x17\n" + @@ -3301,7 +3309,10 @@ const file_worker_proto_rawDesc = "" + "dataCenter\x12\x1b\n" + "\tvolume_id\x18\x05 \x01(\rR\bvolumeId\x12\x1b\n" + "\tshard_ids\x18\x06 \x03(\rR\bshardIds\x12%\n" + - "\x0eestimated_size\x18\a \x01(\x04R\restimatedSize\"\xcf\x01\n" + + "\x0eestimated_size\x18\a \x01(\x04R\restimatedSize\x12\x1e\n" + + "\n" + + "generation\x18\b \x01(\rR\n" + + "generation\"\xcf\x01\n" + "\n" + "TaskTarget\x12\x12\n" + "\x04node\x18\x01 \x01(\tR\x04node\x12\x17\n" +