-
Notifications
You must be signed in to change notification settings - Fork 911
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proto and persistence definitions for replicated versioning (#4172)
- Loading branch information
Showing
12 changed files
with
298 additions
and
33 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
Submodule api
updated
3 files
+1 −1 | temporal/api/protocol/v1/message.proto | |
+4 −7 | temporal/api/taskqueue/v1/message.proto | |
+5 −0 | temporal/api/workflowservice/v1/request_response.proto |
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
86 changes: 86 additions & 0 deletions
86
proto/internal/temporal/server/api/persistence/v1/task_queues.proto
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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// Copyright (c) 2020 Temporal Technologies, Inc. | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
syntax = "proto3"; | ||
|
||
package temporal.server.api.persistence.v1; | ||
option go_package = "go.temporal.io/server/api/persistence/v1;persistence"; | ||
|
||
import "temporal/server/api/clock/v1/message.proto"; | ||
|
||
// BuildID is an identifier with a timestamped status used to identify workers for task queue versioning purposes. | ||
message BuildID { | ||
enum State { | ||
STATE_UNSPECIFIED = 0; | ||
STATE_ACTIVE = 1; | ||
STATE_DELETED = 2; | ||
}; | ||
|
||
string id = 1; | ||
State state = 2; | ||
// HLC timestamp representing when the state was updated or the when build ID was originally inserted. | ||
// (-- api-linter: core::0142::time-field-type=disabled | ||
// aip.dev/not-precedent: Using HLC instead of wall clock. --) | ||
temporal.server.api.clock.v1.HybridLogicalClock state_update_timestamp = 3; | ||
} | ||
|
||
// An internal represenation of temporal.api.taskqueue.v1.CompatibleVersionSet | ||
message CompatibleVersionSet { | ||
// Set IDs are used internally by matching. | ||
// A set typically has one set ID and extra care is taken to enforce this. | ||
// In split brain scenarios, there may be conflicting concurrent writes to the task queue versioning data, in which | ||
// case a set might end up with more than one ID. | ||
repeated string set_ids = 1; | ||
// All the compatible versions, unordered except for the last element, which is considered the set "default". | ||
repeated BuildID build_ids = 2; | ||
// HLC timestamp representing when the set default was updated. Different from BuildID.state_update_timestamp, which | ||
// refers to the build ID status. | ||
// (-- api-linter: core::0142::time-field-type=disabled | ||
// aip.dev/not-precedent: Using HLC instead of wall clock. --) | ||
temporal.server.api.clock.v1.HybridLogicalClock default_update_timestamp = 3; | ||
} | ||
|
||
// Holds all the data related to worker versioning for a task queue. | ||
// Backwards-incompatible changes cannot be made, as this would make existing stored data unreadable. | ||
message VersioningData { | ||
// All the incompatible version sets, unordered except for the last element, which is considered the set "default". | ||
repeated CompatibleVersionSet version_sets = 1; | ||
// HLC timestamp representing when the default set was last updated or established. | ||
// (-- api-linter: core::0142::time-field-type=disabled | ||
// aip.dev/not-precedent: Using HLC instead of wall clock. --) | ||
temporal.server.api.clock.v1.HybridLogicalClock default_update_timestamp = 2; | ||
} | ||
|
||
// Container for all persistent user provided data for a task queue. | ||
// Task queue as a named concept here is close to how users interpret them, rather than relating to some specific type | ||
// (workflow vs activity, etc) and thus, as a consequence, any data that applies to a specific type (say, activity rate | ||
// limiting) should be defined as such within this structure. | ||
// This data must all fit in a single DB column and is kept cached in-memory, take extra care to ensure data added here | ||
// has reasonable size limits imposed on it. | ||
message TaskQueueUserData { | ||
// The last recorded cluster-local Hybrid Logical Clock timestamp for _this_ task queue. | ||
// Updated whenever user data is directly updated due to a user action but not when applying replication events. | ||
// The clock is referenced when new timestamps are generated to ensure it produces monotonically increasing | ||
// timestamps. | ||
temporal.server.api.clock.v1.HybridLogicalClock clock = 1; | ||
VersioningData versioning_data = 2; | ||
|
||
// For future use: description, rate limits, manual partition control, etc... | ||
} |
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