Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ members = [
"engine/sdks/rust/test-envoy",
"engine/sdks/rust/universaldb-commit",
"engine/sdks/rust/ups-protocol",
"engine/sdks/rust/v2-migration-protocol",
"rivetkit-rust/packages/actor-persist",
"rivetkit-rust/packages/client",
"rivetkit-rust/packages/client-protocol",
Expand Down Expand Up @@ -699,6 +700,9 @@ members = [
[workspace.dependencies.epoxy-protocol]
path = "engine/sdks/rust/epoxy-protocol"

[workspace.dependencies.v2-migration-protocol]
path = "engine/sdks/rust/v2-migration-protocol"

[workspace.dependencies.rivet-test-envoy]
path = "engine/sdks/rust/test-envoy"

Expand Down
31 changes: 31 additions & 0 deletions docs/api/error-registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,37 @@
}
]
},
{
"name": "migration",
"description": null,
"errors": [
{
"code": "actor_not_found",
"message": "The actor does not exist in this namespace.",
"statuses": []
},
{
"code": "backfill_incomplete",
"message": "Migration is unavailable until the actor migration fix backfill finishes.",
"statuses": []
},
{
"code": "cutover_mismatch",
"message": "The actor was parked by a different cutover.",
"statuses": []
},
{
"code": "invalid_request",
"message": "Invalid migration request.",
"statuses": []
},
{
"code": "wrong_datacenter",
"message": "The actor belongs to another datacenter.",
"statuses": []
}
]
},
{
"name": "namespace",
"description": "Namespace lookup and creation.",
Expand Down
8 changes: 8 additions & 0 deletions engine/artifacts/config-schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions engine/artifacts/errors/migration.actor_not_found.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions engine/artifacts/errors/migration.backfill_incomplete.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions engine/artifacts/errors/migration.cutover_mismatch.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions engine/artifacts/errors/migration.invalid_request.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions engine/artifacts/errors/migration.wrong_datacenter.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions engine/packages/api-public/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ license.workspace = true

[dependencies]
anyhow.workspace = true
async-stream.workspace = true
axum.workspace = true
base64.workspace = true
depot.workspace = true
epoxy-protocol.workspace = true
epoxy.workspace = true
futures-util.workspace = true
Expand All @@ -17,6 +20,7 @@ include_dir.workspace = true
indexmap.workspace = true
namespace.workspace = true
pegboard.workspace = true
rand.workspace = true
reqwest.workspace = true
rivet-api-builder.workspace = true
rivet-api-peer.workspace = true
Expand All @@ -37,8 +41,12 @@ subtle.workspace = true
tokio.workspace = true
tower-http.workspace = true
tracing.workspace = true
universaldb.workspace = true
urlencoding.workspace = true
utoipa.workspace = true
v2-migration-protocol.workspace = true
vbare.workspace = true
xxhash-rust.workspace = true

[build-dependencies]
anyhow.workspace = true
Expand Down
37 changes: 37 additions & 0 deletions engine/packages/api-public/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,40 @@ pub enum Validation {
)]
RaceCondition,
}

#[derive(RivetError, Debug, Deserialize, Serialize)]
#[error("migration")]
pub enum Migration {
#[error("actor_not_found", "The actor does not exist in this namespace.")]
ActorNotFound,
#[error(
"wrong_datacenter",
"The actor belongs to another datacenter.",
"The actor belongs to datacenter {actor_datacenter_label}, but this is datacenter {datacenter_label}. Call the owning datacenter's API."
)]
WrongDatacenter {
actor_datacenter_label: u16,
datacenter_label: u16,
},
#[error(
"invalid_request",
"Invalid migration request.",
"Invalid migration request: {message}"
)]
InvalidRequest { message: String },
#[error(
"cutover_mismatch",
"The actor was parked by a different cutover.",
"The actor was parked by cutover {parked_cutover_ts}, not {cutover_ts}."
)]
CutoverMismatch {
parked_cutover_ts: i64,
cutover_ts: i64,
},
#[error(
"backfill_incomplete",
"Migration is unavailable until the actor migration fix backfill finishes.",
"Migration is unavailable until the actor migration fix backfill finishes. It runs on engine start; retry once it completes."
)]
BackfillIncomplete,
}
1 change: 1 addition & 0 deletions engine/packages/api-public/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub mod envoys;
mod errors;
pub mod health;
pub mod metadata;
pub mod migration;
pub mod namespaces;
pub mod router;
pub mod runner_configs;
Expand Down
Loading
Loading