diff --git a/.editorconfig b/.editorconfig index 5cbd38093..4cefbcfa8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,8 +6,8 @@ insert_final_newline = true charset = utf-8 [*.go] -indent_style = tab -tab_width = 8 +indent_style = space +indent_size = 4 [*.proto] indent_style = space diff --git a/cmd/rpc_test_server/main.go b/cmd/rpc_test_server/main.go index 99bbd0ab1..6acdef81c 100644 --- a/cmd/rpc_test_server/main.go +++ b/cmd/rpc_test_server/main.go @@ -1,3 +1,4 @@ +//go:build rpc_e2e // +build rpc_e2e package main diff --git a/pkg/varlog/subscribe.go b/pkg/varlog/subscribe.go index b8b7419aa..b8a47b6af 100644 --- a/pkg/varlog/subscribe.go +++ b/pkg/varlog/subscribe.go @@ -396,7 +396,7 @@ func (p *transmitter) handleResult(r transmitResult) error { var err error /* NOTE Ignore transmitResult with GLSN less than p.wanted. - They can be delivered by subscribers that have not yet closed. + They can be delivered by subscribers that have not yet closed. */ if r.result.GLSN == types.InvalidGLSN { err = p.handleError(r) diff --git a/proto/mrpb/management.proto b/proto/mrpb/management.proto index e9a9a6896..cbec4c59d 100644 --- a/proto/mrpb/management.proto +++ b/proto/mrpb/management.proto @@ -16,14 +16,12 @@ option (gogoproto.goproto_sizecache_all) = false; message AddPeerRequest { uint32 cluster_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.ClusterID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.ClusterID", (gogoproto.customname) = "ClusterID" ]; uint64 node_id = 2 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.NodeID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.NodeID", (gogoproto.customname) = "NodeID" ]; @@ -32,22 +30,19 @@ message AddPeerRequest { message RemovePeerRequest { uint32 cluster_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.ClusterID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.ClusterID", (gogoproto.customname) = "ClusterID" ]; uint64 node_id = 2 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.NodeID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.NodeID", (gogoproto.customname) = "NodeID" ]; } message GetClusterInfoRequest { uint32 cluster_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.ClusterID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.ClusterID", (gogoproto.customname) = "ClusterID" ]; } @@ -60,27 +55,24 @@ message ClusterInfo { } uint32 cluster_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.ClusterID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.ClusterID", (gogoproto.customname) = "ClusterID", (gogoproto.jsontag) = "clusterId" ]; uint64 node_id = 2 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.NodeID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.NodeID", (gogoproto.customname) = "NodeID", (gogoproto.jsontag) = "nodeId" ]; - uint64 leader = 3 [(gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.NodeID"]; + uint64 leader = 3 + [(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.NodeID"]; int32 replication_factor = 4 [(gogoproto.jsontag) = "replicationFactor"]; map members = 5 - [(gogoproto.castkey) = - "github.com/kakao/varlog/pkg/types.NodeID"]; + [(gogoproto.castkey) = "github.com/kakao/varlog/pkg/types.NodeID"]; // applied_index is the AppliedIndex of RAFT that is updated by changing // configuration of members. For example, AddPeer and RemovePeer result in diff --git a/proto/mrpb/metadata_repository.proto b/proto/mrpb/metadata_repository.proto index 9a3707838..924fbad94 100644 --- a/proto/mrpb/metadata_repository.proto +++ b/proto/mrpb/metadata_repository.proto @@ -31,13 +31,11 @@ message LogStreamRequest { message SealRequest { uint32 cluster_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.ClusterID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.ClusterID", (gogoproto.customname) = "ClusterID" ]; int32 log_stream_id = 2 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.LogStreamID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.LogStreamID", (gogoproto.customname) = "LogStreamID" ]; } @@ -52,13 +50,11 @@ message SealResponse { message UnsealRequest { uint32 cluster_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.ClusterID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.ClusterID", (gogoproto.customname) = "ClusterID" ]; int32 log_stream_id = 2 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.LogStreamID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.LogStreamID", (gogoproto.customname) = "LogStreamID" ]; } @@ -69,8 +65,7 @@ message UnsealResponse { message TopicRequest { int32 topic_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.TopicID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.TopicID", (gogoproto.customname) = "TopicID" ]; } @@ -78,7 +73,7 @@ message TopicRequest { service MetadataRepositoryService { rpc RegisterStorageNode(StorageNodeRequest) returns (google.protobuf.Empty) {} rpc UnregisterStorageNode(StorageNodeRequest) - returns (google.protobuf.Empty) {} + returns (google.protobuf.Empty) {} rpc RegisterTopic(TopicRequest) returns (google.protobuf.Empty) {} rpc UnregisterTopic(TopicRequest) returns (google.protobuf.Empty) {} rpc RegisterLogStream(LogStreamRequest) returns (google.protobuf.Empty) {} diff --git a/proto/mrpb/raft_entry.proto b/proto/mrpb/raft_entry.proto index 4d1403b53..417e4705f 100644 --- a/proto/mrpb/raft_entry.proto +++ b/proto/mrpb/raft_entry.proto @@ -24,24 +24,21 @@ message RegisterStorageNode { message UnregisterStorageNode { int32 storage_node_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.StorageNodeID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.StorageNodeID", (gogoproto.customname) = "StorageNodeID" ]; } message RegisterTopic { int32 topic_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.TopicID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.TopicID", (gogoproto.customname) = "TopicID" ]; } message UnregisterTopic { int32 topic_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.TopicID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.TopicID", (gogoproto.customname) = "TopicID" ]; } @@ -52,8 +49,7 @@ message RegisterLogStream { message UnregisterLogStream { int32 log_stream_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.LogStreamID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.LogStreamID", (gogoproto.customname) = "LogStreamID" ]; } @@ -64,55 +60,49 @@ message UpdateLogStream { message Report { int32 storage_node_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.StorageNodeID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.StorageNodeID", (gogoproto.customname) = "StorageNodeID" ]; repeated snpb.LogStreamUncommitReport uncommit_report = 3 - [(gogoproto.nullable) = false]; + [(gogoproto.nullable) = false]; } message Reports { uint64 node_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.NodeID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.NodeID", (gogoproto.customname) = "NodeID" ]; google.protobuf.Timestamp created_time = 2 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; repeated Report reports = 3; } message Commit { uint64 node_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.NodeID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.NodeID", (gogoproto.customname) = "NodeID" ]; google.protobuf.Timestamp created_time = 2 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; } message Seal { int32 log_stream_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.LogStreamID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.LogStreamID", (gogoproto.customname) = "LogStreamID" ]; } message Unseal { int32 log_stream_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.LogStreamID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.LogStreamID", (gogoproto.customname) = "LogStreamID" ]; } message AddPeer { uint64 node_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.NodeID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.NodeID", (gogoproto.customname) = "NodeID" ]; string url = 2; @@ -121,16 +111,14 @@ message AddPeer { message RemovePeer { uint64 node_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.NodeID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.NodeID", (gogoproto.customname) = "NodeID" ]; } message Endpoint { uint64 node_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.NodeID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.NodeID", (gogoproto.customname) = "NodeID" ]; string url = 2; diff --git a/proto/mrpb/raft_metadata_repository.proto b/proto/mrpb/raft_metadata_repository.proto index 7b759e40b..e493ef51c 100644 --- a/proto/mrpb/raft_metadata_repository.proto +++ b/proto/mrpb/raft_metadata_repository.proto @@ -20,28 +20,25 @@ message LogStreamCommitResults { option (gogoproto.equal) = true; uint64 version = 1 - [(gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.Version"]; + [(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.Version"]; repeated snpb.LogStreamCommitResult commit_results = 3 - [(gogoproto.nullable) = false]; + [(gogoproto.nullable) = false]; } message StorageNodeUncommitReport { int32 storage_node_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.StorageNodeID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.StorageNodeID", (gogoproto.customname) = "StorageNodeID" ]; repeated snpb.LogStreamUncommitReport uncommit_reports = 2 - [(gogoproto.nullable) = false]; + [(gogoproto.nullable) = false]; } message LogStreamUncommitReports { option (gogoproto.equal) = true; map replicas = 1 [ - (gogoproto.castkey) = - "github.com/kakao/varlog/pkg/types.StorageNodeID", + (gogoproto.castkey) = "github.com/kakao/varlog/pkg/types.StorageNodeID", (gogoproto.nullable) = false ]; varlogpb.LogStreamStatus status = 2; @@ -50,13 +47,11 @@ message LogStreamUncommitReports { message MetadataRepositoryDescriptor { message LogStreamDescriptor { uint64 trim_version = 1 - [(gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.Version"]; + [(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.Version"]; repeated LogStreamCommitResults commit_history = 2 - [(gogoproto.nullable) = true]; + [(gogoproto.nullable) = true]; map uncommit_reports = 3 - [(gogoproto.castkey) = - "github.com/kakao/varlog/pkg/types.LogStreamID"]; + [(gogoproto.castkey) = "github.com/kakao/varlog/pkg/types.LogStreamID"]; } message PeerDescriptor { @@ -66,8 +61,7 @@ message MetadataRepositoryDescriptor { message PeerDescriptorMap { map peers = 1 - [(gogoproto.castkey) = - "github.com/kakao/varlog/pkg/types.NodeID"]; + [(gogoproto.castkey) = "github.com/kakao/varlog/pkg/types.NodeID"]; // applied_index is the AppliedIndex of RAFT that is updated by changing // configuration of members. For example, AddPeer and RemovePeer result // in increasing applied_index. @@ -78,6 +72,5 @@ message MetadataRepositoryDescriptor { LogStreamDescriptor log_stream = 2 [(gogoproto.nullable) = true]; PeerDescriptorMap peers_map = 3 [(gogoproto.nullable) = false]; map endpoints = 4 - [(gogoproto.castkey) = - "github.com/kakao/varlog/pkg/types.NodeID"]; + [(gogoproto.castkey) = "github.com/kakao/varlog/pkg/types.NodeID"]; } diff --git a/proto/snpb/log_io.proto b/proto/snpb/log_io.proto index 4931c328c..a19d7922f 100644 --- a/proto/snpb/log_io.proto +++ b/proto/snpb/log_io.proto @@ -156,7 +156,7 @@ message LogStreamMetadataRequest { message LogStreamMetadataResponse { varlogpb.LogStreamDescriptor log_stream_descriptor = 1 - [(gogoproto.nullable) = false]; + [(gogoproto.nullable) = false]; } message LogStreamReplicaMetadataRequest { @@ -172,7 +172,7 @@ message LogStreamReplicaMetadataRequest { message LogStreamReplicaMetadataResponse { LogStreamReplicaMetadataDescriptor log_stream_replica = 1 - [(gogoproto.nullable) = false]; + [(gogoproto.nullable) = false]; } service LogIO { @@ -182,7 +182,7 @@ service LogIO { rpc SubscribeTo(SubscribeToRequest) returns (stream SubscribeToResponse) {} rpc TrimDeprecated(TrimDeprecatedRequest) returns (google.protobuf.Empty) {} rpc LogStreamReplicaMetadata(LogStreamReplicaMetadataRequest) - returns (LogStreamReplicaMetadataResponse) {} + returns (LogStreamReplicaMetadataResponse) {} rpc LogStreamMetadata(LogStreamMetadataRequest) - returns (LogStreamMetadataResponse) {} + returns (LogStreamMetadataResponse) {} } diff --git a/proto/snpb/log_stream_reporter.proto b/proto/snpb/log_stream_reporter.proto index ac6761087..8b809f887 100644 --- a/proto/snpb/log_stream_reporter.proto +++ b/proto/snpb/log_stream_reporter.proto @@ -27,11 +27,11 @@ message LogStreamUncommitReport { (gogoproto.customname) = "UncommittedLLSNOffset" ]; uint64 uncommitted_llsn_length = 3 - [(gogoproto.customname) = "UncommittedLLSNLength"]; + [(gogoproto.customname) = "UncommittedLLSNLength"]; uint64 version = 4 - [(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.Version"]; + [(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.Version"]; uint64 high_watermark = 5 - [(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.GLSN"]; + [(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.GLSN"]; } message GetReportRequest {} @@ -41,7 +41,7 @@ message GetReportResponse { (gogoproto.customname) = "StorageNodeID" ]; repeated LogStreamUncommitReport uncommit_reports = 2 - [(gogoproto.nullable) = false]; + [(gogoproto.nullable) = false]; } // GlobalLogStreamDescriptor is a committing result against with @@ -69,9 +69,9 @@ message LogStreamCommitResult { (gogoproto.customname) = "CommittedGLSNOffset" ]; uint64 committed_glsn_length = 5 - [(gogoproto.customname) = "CommittedGLSNLength"]; + [(gogoproto.customname) = "CommittedGLSNLength"]; uint64 version = 6 - [(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.Version"]; + [(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.Version"]; uint64 high_watermark = 7 [ (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.GLSN", (gogoproto.customname) = "HighWatermark" @@ -96,7 +96,7 @@ message CommitBatchRequest { (gogoproto.customname) = "StorageNodeID" ]; repeated LogStreamCommitResult commit_results = 2 - [(gogoproto.nullable) = false]; + [(gogoproto.nullable) = false]; } message CommitBatchResponse { diff --git a/proto/snpb/management.proto b/proto/snpb/management.proto index 687365850..73dcd06e8 100644 --- a/proto/snpb/management.proto +++ b/proto/snpb/management.proto @@ -50,7 +50,7 @@ message AddLogStreamReplicaRequest { } message AddLogStreamReplicaResponse { LogStreamReplicaMetadataDescriptor log_stream_replica = 1 - [(gogoproto.nullable) = false]; + [(gogoproto.nullable) = false]; } message RemoveLogStreamRequest { @@ -121,7 +121,7 @@ message UnsealRequest { (gogoproto.customname) = "LogStreamID" ]; repeated varlogpb.LogStreamReplica replicas = 5 - [(gogoproto.nullable) = false]; + [(gogoproto.nullable) = false]; } message SyncRequest { @@ -169,7 +169,7 @@ message TrimRequest { message TrimResponse { map results = 1 - [(gogoproto.castkey) = "github.com/kakao/varlog/pkg/types.LogStreamID"]; + [(gogoproto.castkey) = "github.com/kakao/varlog/pkg/types.LogStreamID"]; } // Management defines the public APIs for managing StorageNode. @@ -178,7 +178,7 @@ service Management { rpc GetMetadata(GetMetadataRequest) returns (GetMetadataResponse) {} // AddLogStreamReplica adds a new log stream replica to a storage node. rpc AddLogStreamReplica(AddLogStreamReplicaRequest) - returns (AddLogStreamReplicaResponse) {} + returns (AddLogStreamReplicaResponse) {} // RemoveLogStream removes a LogStream from StorageNode. rpc RemoveLogStream(RemoveLogStreamRequest) returns (google.protobuf.Empty) {} // Seal changes the status of LogStreamExecutor to LogStreamStatusSealing or diff --git a/proto/snpb/metadata.proto b/proto/snpb/metadata.proto index 1e9dd133a..150695616 100644 --- a/proto/snpb/metadata.proto +++ b/proto/snpb/metadata.proto @@ -37,11 +37,11 @@ message StorageNodeMetadataDescriptor { ]; repeated varlogpb.StorageDescriptor storages = 3 - [(gogoproto.nullable) = false]; + [(gogoproto.nullable) = false]; // LogStreams are the list of metadata for log stream replicas. repeated LogStreamReplicaMetadataDescriptor log_stream_replicas = 4 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "logStreams"]; + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "logStreams"]; varlogpb.StorageNodeStatus status = 5; @@ -73,7 +73,7 @@ message LogStreamReplicaMetadataDescriptor { // Version is the latest version of the commit received from the metadata // repository. uint64 version = 3 - [(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.Version"]; + [(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.Version"]; // GlobalHighWatermark is the latest high watermark received from the metadata // repository. @@ -87,7 +87,7 @@ message LogStreamReplicaMetadataDescriptor { // The LocalLowWatermark becomes higher when the log is truncated by prefix // trimming. varlogpb.LogSequenceNumber local_low_watermark = 5 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "localLowWatermark"]; + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "localLowWatermark"]; // LocalHighWatermark is the last log sequence number in the log stream // replica. diff --git a/proto/snpb/replicator.proto b/proto/snpb/replicator.proto index c7b1893ea..6f99b2e3b 100644 --- a/proto/snpb/replicator.proto +++ b/proto/snpb/replicator.proto @@ -20,13 +20,11 @@ option (gogoproto.goproto_sizecache_all) = false; // a log position in the local log stream of the primary storage node. message ReplicationRequest { int32 topic_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.TopicID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.TopicID", (gogoproto.customname) = "TopicID" ]; int32 log_stream_id = 2 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.LogStreamID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.LogStreamID", (gogoproto.customname) = "LogStreamID" ]; uint64 llsn = 3 [ @@ -48,13 +46,11 @@ message ReplicationResponse { message ReplicateRequest { int32 topic_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.TopicID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.TopicID", (gogoproto.customname) = "TopicID" ]; int32 log_stream_id = 2 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.LogStreamID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.LogStreamID", (gogoproto.customname) = "LogStreamID" ]; repeated uint64 llsn = 3 [ @@ -114,8 +110,7 @@ message SyncPayload { message SyncInitRequest { uint32 cluster_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.ClusterID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.ClusterID", (gogoproto.customname) = "ClusterID" ]; varlogpb.LogStreamReplica source = 2 [(gogoproto.nullable) = false]; @@ -129,8 +124,7 @@ message SyncInitResponse { message SyncReplicateRequest { uint32 cluster_id = 1 [ - (gogoproto.casttype) = - "github.com/kakao/varlog/pkg/types.ClusterID", + (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.ClusterID", (gogoproto.customname) = "ClusterID" ]; varlogpb.LogStreamReplica source = 2 [(gogoproto.nullable) = false]; @@ -144,7 +138,7 @@ message SyncReplicateResponse { service Replicator { rpc ReplicateDeprecated(stream ReplicationRequest) - returns (stream ReplicationResponse) {} + returns (stream ReplicationResponse) {} rpc Replicate(stream ReplicateRequest) returns (ReplicateResponse) {} rpc SyncInit(SyncInitRequest) returns (SyncInitResponse) {} rpc SyncReplicate(SyncReplicateRequest) returns (SyncReplicateResponse) {} diff --git a/proto/varlogpb/metadata.proto b/proto/varlogpb/metadata.proto index 5dfeb11b0..a47298c89 100644 --- a/proto/varlogpb/metadata.proto +++ b/proto/varlogpb/metadata.proto @@ -21,11 +21,11 @@ message MetadataDescriptor { uint64 applied_index = 1 [(gogoproto.jsontag) = "appliedIndex"]; repeated StorageNodeDescriptor storage_nodes = 2 - [(gogoproto.nullable) = true, (gogoproto.jsontag) = "storageNodes"]; + [(gogoproto.nullable) = true, (gogoproto.jsontag) = "storageNodes"]; repeated LogStreamDescriptor log_streams = 3 - [(gogoproto.nullable) = true, (gogoproto.jsontag) = "logStreams"]; + [(gogoproto.nullable) = true, (gogoproto.jsontag) = "logStreams"]; repeated TopicDescriptor topics = 4 - [(gogoproto.nullable) = true, (gogoproto.jsontag) = "topics"]; + [(gogoproto.nullable) = true, (gogoproto.jsontag) = "topics"]; } // StorageNodeDescriptor is immutable metadata to persist information of a @@ -54,9 +54,9 @@ enum StorageNodeStatus { option (gogoproto.goproto_enum_prefix) = false; STORAGE_NODE_STATUS_RUNNING = 0 - [(gogoproto.enumvalue_customname) = "StorageNodeStatusRunning"]; + [(gogoproto.enumvalue_customname) = "StorageNodeStatusRunning"]; STORAGE_NODE_STATUS_DELETED = 1 - [(gogoproto.enumvalue_customname) = "StorageNodeStatusDeleted"]; + [(gogoproto.enumvalue_customname) = "StorageNodeStatusDeleted"]; } message StorageDescriptor { @@ -90,24 +90,24 @@ message LogStreamDescriptor { // elsewhere other than the metadata repository. It leads to misusing the // LogStreamDescriptor. LogEntryMeta head = 5 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "head,omitempty"]; + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "head,omitempty"]; LogEntryMeta tail = 6 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "tail,omitempty"]; + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "tail,omitempty"]; } enum LogStreamStatus { option (gogoproto.goproto_enum_prefix) = false; LS_STATUS_RUNNING = 0 - [(gogoproto.enumvalue_customname) = "LogStreamStatusRunning"]; + [(gogoproto.enumvalue_customname) = "LogStreamStatusRunning"]; LS_STATUS_SEALING = 1 - [(gogoproto.enumvalue_customname) = "LogStreamStatusSealing"]; + [(gogoproto.enumvalue_customname) = "LogStreamStatusSealing"]; LS_STATUS_SEALED = 2 - [(gogoproto.enumvalue_customname) = "LogStreamStatusSealed"]; + [(gogoproto.enumvalue_customname) = "LogStreamStatusSealed"]; LS_STATUS_DELETED = 3 - [(gogoproto.enumvalue_customname) = "LogStreamStatusDeleted"]; + [(gogoproto.enumvalue_customname) = "LogStreamStatusDeleted"]; LS_STATUS_UNSEALING = 4 - [(gogoproto.enumvalue_customname) = "LogStreamStatusUnsealing"]; + [(gogoproto.enumvalue_customname) = "LogStreamStatusUnsealing"]; } // ReplicaDescriptor represents a storage node and directory where a log stream @@ -151,9 +151,9 @@ enum TopicStatus { option (gogoproto.goproto_enum_prefix) = false; TOPIC_STATUS_RUNNING = 0 - [(gogoproto.enumvalue_customname) = "TopicStatusRunning"]; + [(gogoproto.enumvalue_customname) = "TopicStatusRunning"]; TOPIC_STATUS_DELETED = 1 - [(gogoproto.enumvalue_customname) = "TopicStatusDeleted"]; + [(gogoproto.enumvalue_customname) = "TopicStatusDeleted"]; } // StorageNode is a structure to represent identifier and address of storage @@ -242,13 +242,13 @@ message LogEntry { option (gogoproto.equal) = true; LogEntryMeta meta = 1 - [(gogoproto.nullable) = false, (gogoproto.embed) = true]; + [(gogoproto.nullable) = false, (gogoproto.embed) = true]; bytes data = 2; } message CommitContext { uint64 version = 1 - [(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.Version"]; + [(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.Version"]; uint64 high_watermark = 2 [ (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.GLSN", (gogoproto.customname) = "HighWatermark" @@ -274,9 +274,9 @@ message MetadataRepositoryNode { (gogoproto.jsontag) = "nodeId" ]; string raft_url = 2 - [(gogoproto.customname) = "RaftURL", (gogoproto.jsontag) = "raftURL"]; + [(gogoproto.customname) = "RaftURL", (gogoproto.jsontag) = "raftURL"]; string rpc_addr = 3 - [(gogoproto.customname) = "RPCAddr", (gogoproto.jsontag) = "rpcAddr"]; + [(gogoproto.customname) = "RPCAddr", (gogoproto.jsontag) = "rpcAddr"]; bool leader = 4 [(gogoproto.jsontag) = "leader"]; bool learner = 5 [(gogoproto.jsontag) = "learner"]; } diff --git a/proto/vmspb/admin.proto b/proto/vmspb/admin.proto index 25569d3fb..f07e23d7c 100644 --- a/proto/vmspb/admin.proto +++ b/proto/vmspb/admin.proto @@ -60,7 +60,7 @@ message ListStorageNodesRequest {} message ListStorageNodesResponse { // StorageNodes registered to the cluster. repeated StorageNodeMetadata storage_nodes = 1 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "storageNodes"]; + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "storageNodes"]; } message AddStorageNodeRequest { varlogpb.StorageNode storage_node = 1 [(gogoproto.nullable) = false]; @@ -94,12 +94,12 @@ message DescribeTopicRequest { message DescribeTopicResponse { varlogpb.TopicDescriptor topic = 1 [(gogoproto.nullable) = false]; repeated varlogpb.LogStreamDescriptor log_streams = 2 - [(gogoproto.nullable) = false]; + [(gogoproto.nullable) = false]; } message ListTopicsRequest {} message ListTopicsResponse { repeated varlogpb.TopicDescriptor topics = 1 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "topics"]; + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "topics"]; } // AddTopicRequest represents a request to add a topic to the cluster. message AddTopicRequest {} @@ -127,7 +127,7 @@ message GetLogStreamRequest { } message GetLogStreamResponse { varlogpb.LogStreamDescriptor log_stream = 1 - [(gogoproto.jsontag) = "logStream"]; + [(gogoproto.jsontag) = "logStream"]; } message ListLogStreamsRequest { int32 topic_id = 1 [ @@ -137,7 +137,7 @@ message ListLogStreamsRequest { } message ListLogStreamsResponse { repeated varlogpb.LogStreamDescriptor log_streams = 1 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "logStreams"]; + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "logStreams"]; } message AddLogStreamRequest { int32 topic_id = 1 [ @@ -146,7 +146,7 @@ message AddLogStreamRequest { ]; // TODO: nullable = false repeated varlogpb.ReplicaDescriptor replicas = 2 - [(gogoproto.nullable) = true]; + [(gogoproto.nullable) = true]; } message AddLogStreamResponse { varlogpb.LogStreamDescriptor log_stream = 1; @@ -216,7 +216,7 @@ message SealRequest { message SealResponse { repeated snpb.LogStreamReplicaMetadataDescriptor log_streams = 1 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "logStreams"]; + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "logStreams"]; uint64 sealed_glsn = 2 [ (gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.GLSN", (gogoproto.customname) = "SealedGLSN", @@ -237,7 +237,7 @@ message UnsealRequest { message UnsealResponse { varlogpb.LogStreamDescriptor log_stream = 1 - [(gogoproto.jsontag) = "logStream"]; + [(gogoproto.jsontag) = "logStream"]; } message SyncRequest { @@ -302,17 +302,17 @@ message GetMetadataRepositoryNodeResponse { message ListMetadataRepositoryNodesRequest {} message ListMetadataRepositoryNodesResponse { repeated varlogpb.MetadataRepositoryNode nodes = 1 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "nodes"]; + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "nodes"]; } message GetMRMembersResponse { uint64 leader = 1 - [(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.NodeID"]; + [(gogoproto.casttype) = "github.com/kakao/varlog/pkg/types.NodeID"]; int32 replication_factor = 2 - [(gogoproto.jsontag) = "replicationFactor,omitempty"]; + [(gogoproto.jsontag) = "replicationFactor,omitempty"]; map members = 3 - [(gogoproto.castkey) = "github.com/kakao/varlog/pkg/types.NodeID"]; + [(gogoproto.castkey) = "github.com/kakao/varlog/pkg/types.NodeID"]; } message AddMetadataRepositoryNodeRequest { string raft_url = 1 [(gogoproto.customname) = "RaftURL"]; @@ -351,14 +351,14 @@ service ClusterManager { rpc GetStorageNode(GetStorageNodeRequest) returns (GetStorageNodeResponse) {} // ListStorageNodes returns a list of storage nodes in the cluster. rpc ListStorageNodes(ListStorageNodesRequest) - returns (ListStorageNodesResponse) {} + returns (ListStorageNodesResponse) {} // AddStorageNode adds a new storage node to the cluster. // It is idempotent, that is, adding an already added storage node is okay. rpc AddStorageNode(AddStorageNodeRequest) returns (AddStorageNodeResponse) {} // UnregisterStorageNode unregisters the storage node specified by the // request. rpc UnregisterStorageNode(UnregisterStorageNodeRequest) - returns (UnregisterStorageNodeResponse) {} + returns (UnregisterStorageNodeResponse) {} // GetTopic returns the topic specified by the request. rpc GetTopic(GetTopicRequest) returns (GetTopicResponse) {} @@ -370,7 +370,7 @@ service ClusterManager { // AddTopic adds a new topic and returns its metadata. rpc AddTopic(AddTopicRequest) returns (AddTopicResponse) {} rpc UnregisterTopic(UnregisterTopicRequest) - returns (UnregisterTopicResponse) {} + returns (UnregisterTopicResponse) {} rpc GetLogStream(GetLogStreamRequest) returns (GetLogStreamResponse) {} rpc ListLogStreams(ListLogStreamsRequest) returns (ListLogStreamsResponse) {} @@ -391,12 +391,12 @@ service ClusterManager { // TODO: We will define codes for errors returned from storage nodes and // metadata repository soon. rpc UpdateLogStream(UpdateLogStreamRequest) - returns (UpdateLogStreamResponse) {} + returns (UpdateLogStreamResponse) {} rpc UnregisterLogStream(UnregisterLogStreamRequest) - returns (UnregisterLogStreamResponse) {} + returns (UnregisterLogStreamResponse) {} rpc RemoveLogStreamReplica(RemoveLogStreamReplicaRequest) - returns (RemoveLogStreamReplicaResponse) {} + returns (RemoveLogStreamReplicaResponse) {} rpc Seal(SealRequest) returns (SealResponse) {} rpc Unseal(UnsealRequest) returns (UnsealResponse) {} @@ -404,14 +404,14 @@ service ClusterManager { rpc Trim(TrimRequest) returns (TrimResponse) {} rpc GetMetadataRepositoryNode(GetMetadataRepositoryNodeRequest) - returns (GetMetadataRepositoryNodeResponse) {} + returns (GetMetadataRepositoryNodeResponse) {} rpc ListMetadataRepositoryNodes(ListMetadataRepositoryNodesRequest) - returns (ListMetadataRepositoryNodesResponse) {} + returns (ListMetadataRepositoryNodesResponse) {} rpc GetMRMembers(google.protobuf.Empty) returns (GetMRMembersResponse) {} rpc AddMetadataRepositoryNode(AddMetadataRepositoryNodeRequest) - returns (AddMetadataRepositoryNodeResponse) {} + returns (AddMetadataRepositoryNodeResponse) {} rpc AddMRPeer(AddMRPeerRequest) returns (AddMRPeerResponse) {} rpc DeleteMetadataRepositoryNode(DeleteMetadataRepositoryNodeRequest) - returns (DeleteMetadataRepositoryNodeResponse) {} + returns (DeleteMetadataRepositoryNodeResponse) {} rpc RemoveMRPeer(RemoveMRPeerRequest) returns (RemoveMRPeerResponse) {} }