Skip to content

Commit 51333a0

Browse files
authored
[server] UpdateMetadata RPC should update tablePath and physicalTablePath cache (#890)
1 parent ad8b70b commit 51333a0

File tree

48 files changed

+2318
-960
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2318
-960
lines changed

fluss-common/src/main/java/com/alibaba/fluss/cluster/MetadataCache.java

Lines changed: 0 additions & 82 deletions
This file was deleted.

fluss-rpc/src/main/java/com/alibaba/fluss/rpc/gateway/AdminReadOnlyGateway.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@
4545
import com.alibaba.fluss.rpc.messages.MetadataResponse;
4646
import com.alibaba.fluss.rpc.messages.TableExistsRequest;
4747
import com.alibaba.fluss.rpc.messages.TableExistsResponse;
48-
import com.alibaba.fluss.rpc.messages.UpdateMetadataRequest;
49-
import com.alibaba.fluss.rpc.messages.UpdateMetadataResponse;
5048
import com.alibaba.fluss.rpc.protocol.ApiKeys;
5149
import com.alibaba.fluss.rpc.protocol.RPC;
5250

@@ -129,15 +127,6 @@ public interface AdminReadOnlyGateway extends RpcGateway {
129127
@RPC(api = ApiKeys.GET_METADATA)
130128
CompletableFuture<MetadataResponse> metadata(MetadataRequest request);
131129

132-
/**
133-
* request send to tablet server to update the metadata cache for every tablet server node,
134-
* asynchronously.
135-
*
136-
* @return the update metadata response
137-
*/
138-
@RPC(api = ApiKeys.UPDATE_METADATA)
139-
CompletableFuture<UpdateMetadataResponse> updateMetadata(UpdateMetadataRequest request);
140-
141130
/**
142131
* Get the latest kv snapshots of a primary key table. A kv snapshot is a snapshot of a kv
143132
* tablet, so a table can have multiple kv snapshots.

fluss-rpc/src/main/java/com/alibaba/fluss/rpc/gateway/TabletServerGateway.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
import com.alibaba.fluss.rpc.messages.PutKvResponse;
4444
import com.alibaba.fluss.rpc.messages.StopReplicaRequest;
4545
import com.alibaba.fluss.rpc.messages.StopReplicaResponse;
46+
import com.alibaba.fluss.rpc.messages.UpdateMetadataRequest;
47+
import com.alibaba.fluss.rpc.messages.UpdateMetadataResponse;
4648
import com.alibaba.fluss.rpc.protocol.ApiKeys;
4749
import com.alibaba.fluss.rpc.protocol.RPC;
4850

@@ -60,6 +62,15 @@ public interface TabletServerGateway extends RpcGateway, AdminReadOnlyGateway {
6062
CompletableFuture<NotifyLeaderAndIsrResponse> notifyLeaderAndIsr(
6163
NotifyLeaderAndIsrRequest notifyLeaderAndIsrRequest);
6264

65+
/**
66+
* request send to tablet server to update the metadata cache for every tablet server node,
67+
* asynchronously.
68+
*
69+
* @return the update metadata response
70+
*/
71+
@RPC(api = ApiKeys.UPDATE_METADATA)
72+
CompletableFuture<UpdateMetadataResponse> updateMetadata(UpdateMetadataRequest request);
73+
6374
/**
6475
* Stop replica.
6576
*

fluss-rpc/src/main/proto/FlussApi.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ message UpdateMetadataRequest {
170170
optional PbServerNode coordinator_server = 1;
171171
repeated PbServerNode tablet_servers = 2;
172172
repeated PbTableMetadata table_metadata = 3;
173+
repeated PbPartitionMetadata partition_metadata = 4;
174+
optional int32 coordinator_epoch = 5;
173175
}
174176

175177
message UpdateMetadataResponse {
@@ -565,6 +567,9 @@ message PbTableMetadata {
565567
repeated PbBucketMetadata bucket_metadata = 5;
566568
required int64 created_time = 6;
567569
required int64 modified_time = 7;
570+
571+
// TODO add a new filed 'deleted_table' to indicate this table is deleted in UpdateMetadataRequest.
572+
// trace by: https://github.com/alibaba/fluss/issues/981
568573
}
569574

570575
message PbPartitionMetadata {
@@ -581,6 +586,7 @@ message PbBucketMetadata {
581586
optional int32 leader_id = 2;
582587
repeated int32 replica_id = 3 [packed = true];
583588
// TODO: Add isr here.
589+
optional int32 leader_epoch = 4;
584590
}
585591

586592
message PbProduceLogReqForBucket {

0 commit comments

Comments
 (0)