forked from opencurve/curve
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge "add Recommended Configuration" into feature
- Loading branch information
Showing
17 changed files
with
188 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,94 @@ | ||
syntax = "proto2"; | ||
package curve.chunkserver; | ||
|
||
option cc_generic_services = true; | ||
|
||
// Qos 参数 | ||
message QosRequestParas { | ||
optional uint32 clientId = 1; | ||
optional int32 dmclockDelta = 2; | ||
optional int32 dmclockRho = 3; | ||
} | ||
|
||
message QosResponseParas { | ||
optional int32 phase = 1; // 0: 代表 reservation 阶段; 1: 代表 priority 阶段 | ||
optional int32 cost = 2; // | ||
} | ||
|
||
// For chunk | ||
enum CHUNK_OP_TYPE { | ||
CHUNK_OP_DELETE = 0; // 删除 chunk | ||
CHUNK_OP_READ = 1; // 读 chunk | ||
CHUNK_OP_WRITE = 2; // 写 chunk | ||
CHUNK_OP_READ_SNAP = 3; // read chunk snapshot | ||
CHUNK_OP_DELETE_SNAP = 4; // delete chunk snapshot | ||
CHUNK_OP_CREATE_CLONE = 5; // 创建clone chunk | ||
CHUNK_OP_RECOVER = 6; // 恢复clone chunk | ||
CHUNK_OP_PASTE = 7; // paste chunk 内部请求 | ||
CHUNK_OP_UNKNOWN = 8; // 未知 Op | ||
}; | ||
|
||
// read/write 的实际数据在 rpc 的 attachment 中 | ||
message ChunkRequest { | ||
required CHUNK_OP_TYPE opType = 1; // for all | ||
required uint32 logicPoolId = 2; // for all // logicPoolId 实际上 uint16,但是 proto 没有 uint16 | ||
required uint32 copysetId = 3; // for all | ||
required uint64 chunkId = 4; // for all | ||
optional uint64 appliedIndex = 5; // for read | ||
optional uint32 offset = 6; // for read/write | ||
optional uint32 size = 7; // for read/write/clone 创建快照请求中表示请求创建的chunk大小 | ||
optional QosRequestParas deltaRho = 8; // for read/write | ||
optional uint64 sn = 9; // for write/read snapshot 写请求中表示文件当前版本号,读快照请求中表示请求的chunk的版本号 | ||
optional uint64 correctedSn = 10; // for CreateCloneChunk/DeleteChunkSnapshotOrCorrectedSn 用于修改chunk的correctedSn | ||
optional string location = 11; // for clone chunk | ||
}; | ||
|
||
enum CHUNK_OP_STATUS { | ||
CHUNK_OP_STATUS_SUCCESS = 0; // 成功 | ||
CHUNK_OP_STATUS_REDIRECTED = 1; // 不是 leader,重定向 | ||
CHUNK_OP_STATUS_DISK_FAIL = 2; // 磁盘返回错误 | ||
CHUNK_OP_STATUS_CRC_FAIL = 3; // CRC 校验失败 | ||
CHUNK_OP_STATUS_INVALID_REQUEST = 4; // 请求参数不对 | ||
CHUNK_OP_STATUS_NOSPACE = 5; // 空间不够 | ||
CHUNK_OP_STATUS_COPYSET_NOTEXIST = 6; // copyset 不存在 | ||
CHUNK_OP_STATUS_CHUNK_NOTEXIST = 7; // chunk或其快照文件不存在 | ||
CHUNK_OP_STATUS_FAILURE_UNKNOWN = 8; // 其他错误 | ||
}; | ||
|
||
message ChunkResponse { | ||
required CHUNK_OP_STATUS status = 1; | ||
optional string redirect = 2; // 自己不是 leader,重定向给 leader | ||
optional uint64 appliedIndex = 3; // 返回当前最新的 committedIndex, 注意 read 和 write 都要返回 | ||
optional QosResponseParas phaseCost = 4; // for read/write | ||
optional uint64 chunkSn = 5; // for GetChunkInfo 表示chunk文件版本号,0表示不存在 | ||
optional uint64 snapSn = 6; // for GetChunkInfo 表示chunk文件快照的版本号,0表示不存在 | ||
|
||
}; | ||
|
||
message GetChunkInfoRequest { | ||
required uint32 logicPoolId = 1; | ||
required uint32 copysetId = 2; | ||
required uint64 chunkId = 3; | ||
}; | ||
|
||
message GetChunkInfoResponse { | ||
required CHUNK_OP_STATUS status = 1; | ||
optional string redirect = 2; // 自己不是 leader,重定向给 leader | ||
repeated uint64 chunkSn = 3; // chunk 版本号 和 snapshot 版本号 | ||
}; | ||
|
||
service ChunkService { | ||
rpc DeleteChunk (ChunkRequest) returns (ChunkResponse); | ||
rpc ReadChunk (ChunkRequest) returns (ChunkResponse); | ||
rpc WriteChunk (ChunkRequest) returns (ChunkResponse); | ||
|
||
rpc ReadChunkSnapshot (ChunkRequest) returns (ChunkResponse); | ||
rpc DeleteChunkSnapshotOrCorrectSn (ChunkRequest) returns (ChunkResponse); | ||
|
||
rpc GetChunkInfo (GetChunkInfoRequest) returns (GetChunkInfoResponse); | ||
|
||
rpc CreateCloneChunk (ChunkRequest) returns (ChunkResponse); | ||
rpc RecoverChunk (ChunkRequest) returns (ChunkResponse); | ||
}; | ||
syntax = "proto2"; | ||
package curve.chunkserver; | ||
|
||
option cc_generic_services = true; | ||
|
||
// Qos 参数 | ||
message QosRequestParas { | ||
optional uint32 clientId = 1; | ||
optional int32 dmclockDelta = 2; | ||
optional int32 dmclockRho = 3; | ||
} | ||
|
||
message QosResponseParas { | ||
optional int32 phase = 1; // 0: 代表 reservation 阶段; 1: 代表 priority 阶段 | ||
optional int32 cost = 2; // | ||
} | ||
|
||
// For chunk | ||
enum CHUNK_OP_TYPE { | ||
CHUNK_OP_DELETE = 0; // 删除 chunk | ||
CHUNK_OP_READ = 1; // 读 chunk | ||
CHUNK_OP_WRITE = 2; // 写 chunk | ||
CHUNK_OP_READ_SNAP = 3; // read chunk snapshot | ||
// TODO(wudemiao): 后期替换成CHUNK_OP_DELETE_SNAP_OR_CORRECT_SN, | ||
// 保证和chunkserver的接口一致 | ||
CHUNK_OP_DELETE_SNAP = 4; // delete chunk snapshot | ||
CHUNK_OP_CREATE_CLONE = 5; // 创建clone chunk | ||
CHUNK_OP_RECOVER = 6; // 恢复clone chunk | ||
CHUNK_OP_PASTE = 7; // paste chunk 内部请求 | ||
CHUNK_OP_UNKNOWN = 8; // 未知 Op | ||
}; | ||
|
||
// read/write 的实际数据在 rpc 的 attachment 中 | ||
message ChunkRequest { | ||
required CHUNK_OP_TYPE opType = 1; // for all | ||
required uint32 logicPoolId = 2; // for all // logicPoolId 实际上 uint16,但是 proto 没有 uint16 | ||
required uint32 copysetId = 3; // for all | ||
required uint64 chunkId = 4; // for all | ||
optional uint64 appliedIndex = 5; // for read | ||
optional uint32 offset = 6; // for read/write | ||
optional uint32 size = 7; // for read/write/clone 创建快照请求中表示请求创建的chunk大小 | ||
optional QosRequestParas deltaRho = 8; // for read/write | ||
optional uint64 sn = 9; // for write/read snapshot 写请求中表示文件当前版本号,读快照请求中表示请求的chunk的版本号 | ||
optional uint64 correctedSn = 10; // for CreateCloneChunk/DeleteChunkSnapshotOrCorrectedSn 用于修改chunk的correctedSn | ||
optional string location = 11; // for clone chunk | ||
}; | ||
|
||
enum CHUNK_OP_STATUS { | ||
CHUNK_OP_STATUS_SUCCESS = 0; // 成功 | ||
CHUNK_OP_STATUS_REDIRECTED = 1; // 不是 leader,重定向 | ||
CHUNK_OP_STATUS_DISK_FAIL = 2; // 磁盘返回错误 | ||
CHUNK_OP_STATUS_CRC_FAIL = 3; // CRC 校验失败 | ||
CHUNK_OP_STATUS_INVALID_REQUEST = 4; // 请求参数不对 | ||
CHUNK_OP_STATUS_NOSPACE = 5; // 空间不够 | ||
CHUNK_OP_STATUS_COPYSET_NOTEXIST = 6; // copyset 不存在 | ||
CHUNK_OP_STATUS_CHUNK_NOTEXIST = 7; // chunk或其快照文件不存在 | ||
CHUNK_OP_STATUS_FAILURE_UNKNOWN = 8; // 其他错误 | ||
}; | ||
|
||
message ChunkResponse { | ||
required CHUNK_OP_STATUS status = 1; | ||
optional string redirect = 2; // 自己不是 leader,重定向给 leader | ||
optional uint64 appliedIndex = 3; // 返回当前最新的 committedIndex, 注意 read 和 write 都要返回 | ||
optional QosResponseParas phaseCost = 4; // for read/write | ||
optional uint64 chunkSn = 5; // for GetChunkInfo 表示chunk文件版本号,0表示不存在 | ||
optional uint64 snapSn = 6; // for GetChunkInfo 表示chunk文件快照的版本号,0表示不存在 | ||
|
||
}; | ||
|
||
message GetChunkInfoRequest { | ||
required uint32 logicPoolId = 1; | ||
required uint32 copysetId = 2; | ||
required uint64 chunkId = 3; | ||
}; | ||
|
||
message GetChunkInfoResponse { | ||
required CHUNK_OP_STATUS status = 1; | ||
optional string redirect = 2; // 自己不是 leader,重定向给 leader | ||
repeated uint64 chunkSn = 3; // chunk 版本号 和 snapshot 版本号 | ||
}; | ||
|
||
service ChunkService { | ||
rpc DeleteChunk (ChunkRequest) returns (ChunkResponse); | ||
rpc ReadChunk (ChunkRequest) returns (ChunkResponse); | ||
rpc WriteChunk (ChunkRequest) returns (ChunkResponse); | ||
|
||
rpc ReadChunkSnapshot (ChunkRequest) returns (ChunkResponse); | ||
rpc DeleteChunkSnapshotOrCorrectSn (ChunkRequest) returns (ChunkResponse); | ||
|
||
rpc GetChunkInfo (GetChunkInfoRequest) returns (GetChunkInfoResponse); | ||
|
||
rpc CreateCloneChunk (ChunkRequest) returns (ChunkResponse); | ||
rpc RecoverChunk (ChunkRequest) returns (ChunkResponse); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.