Skip to content

Commit 469112a

Browse files
authored
Remove done ephemeral shards (#7212)
What changed? We now remove ephemeral shards that are reported done by the executors Why? This will allow executors to signal that an ephemeral shard should be removed when it's not needed any longer. How did you test it? Unit tests Potential risks Release notes Documentation Changes
1 parent 2684d76 commit 469112a

File tree

13 files changed

+316
-144
lines changed

13 files changed

+316
-144
lines changed

.gen/proto/sharddistributor/v1/executor.pb.go

Lines changed: 42 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.gen/proto/sharddistributor/v1/executor.pb.yarpc.go

Lines changed: 35 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/types/mapper/proto/sharddistributor.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ func ToShardDistributorExecutorHeartbeatRequest(t *sharddistributorv1.HeartbeatR
155155
status = types.ShardStatusINVALID
156156
case sharddistributorv1.ShardStatus_SHARD_STATUS_READY:
157157
status = types.ShardStatusREADY
158+
case sharddistributorv1.ShardStatus_SHARD_STATUS_DONE:
159+
status = types.ShardStatusDONE
158160
}
159161

160162
shardStatusReports[shardKey] = &types.ShardStatusReport{

common/types/sharddistributor.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,14 @@ func (v *ShardStatusReport) GetShardLoad() (o float64) {
152152
return
153153
}
154154

155-
// ShardStatus is ppersisted to the DB with a string value mapping.
155+
// ShardStatus is persisted to the DB with a string value mapping.
156156
// Beware - if we want to change the name - it should be backward compatible and should be done in two steps.
157157
type ShardStatus int32
158158

159159
const (
160160
ShardStatusINVALID ShardStatus = 0
161161
ShardStatusREADY ShardStatus = 1
162+
ShardStatusDONE ShardStatus = 2
162163
)
163164

164165
type ExecutorHeartbeatResponse struct {

common/types/sharddistributor_statuses_enumer_generated.go

Lines changed: 8 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/internal/uber/cadence/sharddistributor/v1/executor.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ message ShardStatusReport {
5757
enum ShardStatus {
5858
SHARD_STATUS_INVALID = 0;
5959
SHARD_STATUS_READY = 1;
60+
SHARD_STATUS_DONE = 2;
6061
}
6162

6263

0 commit comments

Comments
 (0)