mirror of
https://github.com/stablyai/orca.git
synced 2026-11-13 09:27:29 +00:00
refactor(cloud): colocate relay assignment store and tests (#37098)
This commit is contained in:
@@ -38,7 +38,7 @@ import {
|
||||
type RelayAssignment,
|
||||
type RelayAssignmentStore,
|
||||
type ResolvedRelayAssignment
|
||||
} from './assignment-store.js'
|
||||
} from './assignment/assignment-store.js'
|
||||
import { ASSIGNMENT_LEASE_AUDIENCE, assignmentLeaseKeyId } from './assignment/assignment-lease.js'
|
||||
import { AssignmentRejectionLogWindow } from './assignment/assignment-rejection-log-window.js'
|
||||
import { CELL_ADMISSION_STATES } from './cell-admission-selector.js'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract'
|
||||
import { afterEach, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { openInMemoryRelayDatabase, type RelayDatabase } from './database.js'
|
||||
|
||||
const CELL = { id: 'cell-a', url: 'https://relay-a.example.com', capacityRequests: 10 }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterEach, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { RelayCellConfig } from './config.js'
|
||||
import { openInMemoryRelayDatabase, type RelayDatabase } from './database.js'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { RelayAssignmentStore, RelayCellInReserveModeError } from './assignment-store.js'
|
||||
import { RelayAssignmentStore, RelayCellInReserveModeError } from './assignment/assignment-store.js'
|
||||
import type { RelayCellConfig } from './config.js'
|
||||
import { openInMemoryRelayDatabase, type RelayDatabase } from './database.js'
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { RelayAssignmentStore, type AssignOptions, type RelayAssignment } from './assignment-store.js'
|
||||
import {
|
||||
RelayAssignmentStore,
|
||||
type AssignOptions,
|
||||
type RelayAssignment
|
||||
} from './assignment/assignment-store.js'
|
||||
import type { RelayCellConfig } from './config.js'
|
||||
import {
|
||||
openInMemoryRelayDatabase,
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { createHash } from 'node:crypto'
|
||||
import { afterEach, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore, RelayHomeCellUnavailableError } from './assignment-store.js'
|
||||
import {
|
||||
RelayAssignmentStore,
|
||||
RelayHomeCellUnavailableError
|
||||
} from './assignment/assignment-store.js'
|
||||
import {
|
||||
encodeMembership,
|
||||
type CellAdmissionMembership,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import pg from 'pg'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { ASSIGNMENT_CONNECTION_HEADROOM_QUERY } from './assignment-connection-headroom-query.js'
|
||||
import { RelayAssignmentStore } from '../assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import {
|
||||
openRelayDatabase,
|
||||
type RelayDatabase
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract/assignment-invariants'
|
||||
import { afterEach, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from '../assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import type { RelayCellConfig } from '../config.js'
|
||||
import {
|
||||
openInMemoryRelayDatabase,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from '../assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from '../database.js'
|
||||
|
||||
const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
import { randomUUID } from 'node:crypto'
|
||||
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import type { RelayCellConfig } from './config.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from './database.js'
|
||||
import { ReserveLedgerWriter } from './reserve-ledger-writer.js'
|
||||
import type { RelayCellConfig } from '../config.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from '../database.js'
|
||||
import { ReserveLedgerWriter } from '../reserve-ledger-writer.js'
|
||||
|
||||
// Only host-requested moves may leave a reserve cell proven dead by heartbeat and poll silence without a fence; live cells retain hosts.
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import pg from 'pg'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from './database.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from '../database.js'
|
||||
|
||||
const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL
|
||||
const describePostgres = databaseUrl ? describe : describe.skip
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterEach, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from '../assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { openInMemoryRelayDatabase, type RelayDatabase } from '../database.js'
|
||||
|
||||
const NOW = 100_000
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import { afterEach, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore, RelayHomeCellUnavailableError } from './assignment-store.js'
|
||||
import type { RelayCellConfig } from './config.js'
|
||||
import { openInMemoryRelayDatabase, type RelayDatabase } from './database.js'
|
||||
import type { RelayCellConfig } from '../config.js'
|
||||
import { openInMemoryRelayDatabase, type RelayDatabase } from '../database.js'
|
||||
|
||||
const HEARTBEAT_TTL_MS = 45_000
|
||||
const START_MS = 100
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract'
|
||||
import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract/assignment-invariants'
|
||||
import { createHash } from 'node:crypto'
|
||||
import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest'
|
||||
import { RelayAssignmentRowBusyError, RelayAssignmentStore } from './assignment-store.js'
|
||||
@@ -6,9 +6,9 @@ import {
|
||||
encodeMembership,
|
||||
type CellAdmissionMembership,
|
||||
type CellAdmissionState
|
||||
} from './cell-admission-selector.js'
|
||||
import type { RelayCellConfig } from './config.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from './database.js'
|
||||
} from '../cell-admission-selector.js'
|
||||
import type { RelayCellConfig } from '../config.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from '../database.js'
|
||||
|
||||
const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL
|
||||
const describePostgres = databaseUrl ? describe : describe.skip
|
||||
+4
-4
@@ -1,13 +1,13 @@
|
||||
import { createHash } from 'node:crypto'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { RelayAssignmentStore, RelayHomeCellUnavailableError } from './assignment-store.js'
|
||||
import { ReservePaceError } from './reserve-assignment.js'
|
||||
import { ReservePaceError } from '../reserve-assignment.js'
|
||||
import {
|
||||
encodeMembership,
|
||||
type CellAdmissionMembership,
|
||||
type CellAdmissionState
|
||||
} from './cell-admission-selector.js'
|
||||
import type { RelayCellConfig } from './config.js'
|
||||
} from '../cell-admission-selector.js'
|
||||
import type { RelayCellConfig } from '../config.js'
|
||||
import {
|
||||
consumeRelayCellInventoryHold,
|
||||
openInMemoryRelayDatabase,
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
type RelayLockOptions,
|
||||
type RelayTransactionOptions,
|
||||
type SqlRow
|
||||
} from './database.js'
|
||||
} from '../database.js'
|
||||
|
||||
// migration-only also holds evacuation targets, Asia rollback and failed-wave/new cells; only same-cap isolate writes rollIsolatedCells, and restore clears its stamp atomically (orca-relay-operations.md).
|
||||
const HEARTBEAT_TTL_MS = 45_000
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
classifyAssignmentLease
|
||||
} from './assignment-lease.js'
|
||||
import { ASSIGNMENT_LEASE_SHADOW_EVENT, AssignmentLeaseShadow } from './assignment-lease-shadow.js'
|
||||
import type { RelayAssignmentStore } from '../assignment-store.js'
|
||||
import type { RelayAssignmentStore } from './assignment-store.js'
|
||||
import type { RelayConfig } from '../config.js'
|
||||
import type { RelayCredentialStore } from '../credential-store.js'
|
||||
import { HostSessionRegistry } from '../host-session-registry.js'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { RelayHomeCellUnavailableError, type RelayAssignment } from '../assignment-store.js'
|
||||
import { RelayHomeCellUnavailableError, type RelayAssignment } from './assignment-store.js'
|
||||
import type { RelayConfig } from '../config.js'
|
||||
|
||||
const fakes = vi.hoisted(() => ({
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
import { randomUUID } from 'node:crypto'
|
||||
import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract'
|
||||
import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract/assignment-invariants'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { CELL_ADMIT_EFFECTIVE_FRESH_MS, RelayAssignmentStore } from './assignment-store.js'
|
||||
import type { RelayCellConfig } from './config.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from './database.js'
|
||||
import type { RelayCellConfig } from '../config.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from '../database.js'
|
||||
|
||||
// Exercise admit-mode SQL, locked open-flow checks and live-reserve pins on PostgreSQL, not SQLite alone.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from '../assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from '../database.js'
|
||||
|
||||
const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from '../assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import type { RelayDatabase, RelayLockOptions, SqlRow } from '../database.js'
|
||||
import { openInMemoryRelayDatabase } from '../database.js'
|
||||
|
||||
|
||||
+4
-7
@@ -1,23 +1,20 @@
|
||||
import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract'
|
||||
import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract/assignment-invariants'
|
||||
import { createHash } from 'node:crypto'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import type { RelayCellConfig } from './config.js'
|
||||
import type { RelayCellConfig } from '../config.js'
|
||||
import {
|
||||
RelayAssignmentRowBusyError,
|
||||
RelayAssignmentStore,
|
||||
STRANDED_MIGRATION_ABANDON_MS
|
||||
} from './assignment-store.js'
|
||||
import {
|
||||
encodeMembership,
|
||||
type CellAdmissionMembership
|
||||
} from './cell-admission-selector.js'
|
||||
import { encodeMembership, type CellAdmissionMembership } from '../cell-admission-selector.js'
|
||||
import {
|
||||
openInMemoryRelayDatabase,
|
||||
type RelayDatabase,
|
||||
type RelayLockOptions,
|
||||
type RelayTransactionOptions,
|
||||
type SqlRow
|
||||
} from './database.js'
|
||||
} from '../database.js'
|
||||
|
||||
const CELLS: RelayCellConfig[] = [
|
||||
{ id: 'cell-a', url: 'https://relay-a.example.com', capacityRequests: 2 },
|
||||
+43
-43
@@ -1,43 +1,49 @@
|
||||
import { claimDeadManTripSlot } from './cell-dead-man-trip-slot.js'
|
||||
import { createDrainMigrationRowLookup } from './drain-migration-row-lookup.js'
|
||||
import { HeapWindowReaper } from './heap-window-reaper.js'
|
||||
import { PlacementLoadBand } from './placement-load-band.js'
|
||||
import type { SeatFeedCell } from './shadow-seat-directory.js'
|
||||
import { claimDeadManTripSlot } from '../cell-dead-man-trip-slot.js'
|
||||
import { createDrainMigrationRowLookup } from '../drain-migration-row-lookup.js'
|
||||
import { HeapWindowReaper } from '../heap-window-reaper.js'
|
||||
import type { PlacementLoadBand } from '../placement-load-band.js'
|
||||
import type { SeatFeedCell } from '../shadow-seat-directory.js'
|
||||
import {
|
||||
selectIdleRegionalRehomes,
|
||||
type IdleRegionalRehomeCandidate,
|
||||
type IdleRehomeHostCursor
|
||||
} from './idle-regional-rehome-selection.js'
|
||||
} from '../idle-regional-rehome-selection.js'
|
||||
import {
|
||||
RegionalRehomePollTelemetry,
|
||||
type RegionalRehomePollGate
|
||||
} from './regional-rehome-poll-telemetry.js'
|
||||
import { readRegionCorrectionOutcomes } from './region-correction-outcomes.js'
|
||||
import { ReservePaceError } from './reserve-assignment.js'
|
||||
} from '../regional-rehome-poll-telemetry.js'
|
||||
import { readRegionCorrectionOutcomes } from '../region-correction-outcomes.js'
|
||||
import { ReservePaceError } from '../reserve-assignment.js'
|
||||
import {
|
||||
previewRegionalRehomeEligibility,
|
||||
type RegionCorrectionPreview
|
||||
} from './region-correction-preview.js'
|
||||
} from '../region-correction-preview.js'
|
||||
import {
|
||||
exchangeRegionCorrection,
|
||||
previewRegionCorrection,
|
||||
REGIONAL_REHOME_CONCURRENT_LIMIT
|
||||
} from './region-correction-state.js'
|
||||
} from '../region-correction-state.js'
|
||||
import { randomUUID } from 'node:crypto'
|
||||
import { performance } from 'node:perf_hooks'
|
||||
import {
|
||||
ASSIGNMENT_LIMITS,
|
||||
mayNormallyReassign,
|
||||
RELAY_ADMISSION_BUDGETS,
|
||||
mayNormallyReassign
|
||||
} from '@orca-cloud/relay-contract/assignment-invariants'
|
||||
import { RELAY_ADMISSION_BUDGETS } from '@orca-cloud/relay-contract/admission-budgets'
|
||||
import {
|
||||
RELAY_DEFAULT_REGION,
|
||||
RELAY_REGIONS,
|
||||
RELAY_PROTOCOL_LIMITS,
|
||||
type RelayRegion,
|
||||
type RegionCorrectionRequest,
|
||||
type RegionCorrectionResponse,
|
||||
type IdleRegionalRehomeCommit,
|
||||
type IdleRegionalRehomeRequest,
|
||||
} from '@orca-cloud/relay-contract'
|
||||
type RelayRegion
|
||||
} from '@orca-cloud/relay-contract/relay-regions'
|
||||
import { RELAY_PROTOCOL_LIMITS } from '@orca-cloud/relay-contract/protocol-limits'
|
||||
import type {
|
||||
RegionCorrectionRequest,
|
||||
RegionCorrectionResponse
|
||||
} from '@orca-cloud/relay-contract/region-correction'
|
||||
import type {
|
||||
IdleRegionalRehomeCommit,
|
||||
IdleRegionalRehomeRequest
|
||||
} from '@orca-cloud/relay-contract/idle-regional-rehome'
|
||||
import {
|
||||
cellAdmissionState,
|
||||
cellAdmissionStates,
|
||||
@@ -51,14 +57,12 @@ import {
|
||||
type CellAdmissionMembership,
|
||||
type CellAdmissionSelectorInspection,
|
||||
type CellAdmissionState
|
||||
} from './cell-admission-selector.js'
|
||||
} from '../cell-admission-selector.js'
|
||||
import {
|
||||
RelayMigrationCellRegistrar,
|
||||
type MigrationCellRegistration
|
||||
} from './cell-admission-migration-registration.js'
|
||||
import {
|
||||
ASSIGNMENT_CONNECTION_HEADROOM_QUERY
|
||||
} from './assignment/assignment-connection-headroom-query.js'
|
||||
} from '../cell-admission-migration-registration.js'
|
||||
import { ASSIGNMENT_CONNECTION_HEADROOM_QUERY } from './assignment-connection-headroom-query.js'
|
||||
import {
|
||||
CONNECTION_CAP_COLUMNS_SQL,
|
||||
EFFECTIVE_HARD_CAP_SQL,
|
||||
@@ -68,8 +72,8 @@ import {
|
||||
reportedHardCapWithinLimit,
|
||||
writeCellConnectionLimit,
|
||||
type CellConnectionCap
|
||||
} from './cell-connection-cap.js'
|
||||
import { AssignmentIdentityQueue } from './assignment/assignment-identity-queue.js'
|
||||
} from '../cell-connection-cap.js'
|
||||
import { AssignmentIdentityQueue } from './assignment-identity-queue.js'
|
||||
import {
|
||||
CONTROL_RENEWAL_BATCH_SQL,
|
||||
CONTROL_RENEWAL_STATEMENT_OUTCOMES,
|
||||
@@ -78,23 +82,20 @@ import {
|
||||
readControlRenewalOutcomes,
|
||||
type ControlRenewalOutcome,
|
||||
type ControlRenewalRequest
|
||||
} from './control-renewal-statement.js'
|
||||
import {
|
||||
commitWithFinalWrite,
|
||||
REGIONAL_REHOME_DEFAULT_HOST_COOLDOWN_MS
|
||||
} from './database.js'
|
||||
import type { RelayCellConfig } from './config.js'
|
||||
import type { CellLockHoldSite } from './cell-inventory-hold-samples.js'
|
||||
import type { DeadCellVerdict } from './cell-poll-reachability.js'
|
||||
import { isPostgresPoolConnectFailure } from './postgres-pool-pressure.js'
|
||||
import { isPostgresReadTimeout } from './relay-database-rejection-fence.js'
|
||||
} from '../control-renewal-statement.js'
|
||||
import { commitWithFinalWrite, REGIONAL_REHOME_DEFAULT_HOST_COOLDOWN_MS } from '../database.js'
|
||||
import type { RelayCellConfig } from '../config.js'
|
||||
import type { CellLockHoldSite } from '../cell-inventory-hold-samples.js'
|
||||
import type { DeadCellVerdict } from '../cell-poll-reachability.js'
|
||||
import { isPostgresPoolConnectFailure } from '../postgres-pool-pressure.js'
|
||||
import { isPostgresReadTimeout } from '../relay-database-rejection-fence.js'
|
||||
import type {
|
||||
RelayDatabase,
|
||||
RelayLockOptions,
|
||||
RelayTransactionOptions,
|
||||
SqlRow
|
||||
} from './database.js'
|
||||
import type { RegionalRehomeSafetySnapshot } from './relay-observability.js'
|
||||
} from '../database.js'
|
||||
import type { RegionalRehomeSafetySnapshot } from '../relay-observability.js'
|
||||
import {
|
||||
combineRegionalRehomeSafety,
|
||||
nextRegionalRehomeSqlFailuresBreach,
|
||||
@@ -104,16 +105,16 @@ import {
|
||||
regionalRehomeSafetyFailure,
|
||||
regionalRehomeSqlFailuresSustained,
|
||||
type RegionalRehomeSqlFailuresBreach
|
||||
} from './regional-rehome-safety.js'
|
||||
} from '../regional-rehome-safety.js'
|
||||
import {
|
||||
REGIONAL_REHOME_ARRIVAL_WINDOW_MS,
|
||||
type RegionalRehomeAbortReason
|
||||
} from './regional-rehome-abort-reason.js'
|
||||
} from '../regional-rehome-abort-reason.js'
|
||||
import {
|
||||
ABANDONED_REGISTERED_MIGRATION,
|
||||
DURABLY_FENCED_MIGRATION_SOURCE,
|
||||
REGISTERED_MIGRATION_ABANDON_MS
|
||||
} from './registered-migration-abandonment.js'
|
||||
} from '../registered-migration-abandonment.js'
|
||||
|
||||
type AssignmentIdentity = { userId: string; relayHostId: string }
|
||||
type CellHeartbeat = {
|
||||
@@ -164,7 +165,6 @@ export type AssignOptions = {
|
||||
hostRequested?: boolean
|
||||
}
|
||||
|
||||
export type { ControlRenewalOutcome, ControlRenewalRequest }
|
||||
|
||||
// `cellId` null: the reserve-mode set could not be read, so no cell is known to be in db mode.
|
||||
export class RelayCellInReserveModeError extends Error {
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract'
|
||||
import { createHash } from 'node:crypto'
|
||||
import { afterEach, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { encodeMembership } from './cell-admission-selector.js'
|
||||
import {
|
||||
openInMemoryRelayDatabase,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import pg from 'pg'
|
||||
import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { reconcileCellAdmissionAtStartup } from './cell-admission-startup.js'
|
||||
import type { RelayCellConfig } from './config.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from './database.js'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { RelayAssignmentStore } from './assignment-store.js'
|
||||
import type { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { RelayConfig } from './config.js'
|
||||
import { retryTransientDatabaseStartup } from './database-startup-retry.js'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { ASSIGNMENT_CONNECTION_HEADROOM_QUERY } from './assignment/assignment-connection-headroom-query.js'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { RelayCellConfig } from './config.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from './database.js'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createHash } from 'node:crypto'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { encodeMembership, type CellAdmissionMembership } from './cell-admission-selector.js'
|
||||
import type { RelayCellConfig } from './config.js'
|
||||
import { openInMemoryRelayDatabase, type RelayDatabase } from './database.js'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from './database.js'
|
||||
|
||||
const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL
|
||||
|
||||
@@ -32,7 +32,7 @@ vi.mock('pg', () => ({
|
||||
}))
|
||||
|
||||
const { CELL_INVENTORY_LOCK_TIMEOUT_MS, RelayAssignmentStore } = await import(
|
||||
'./assignment-store.js'
|
||||
'./assignment/assignment-store.js'
|
||||
)
|
||||
const { consumeRelayCellInventoryHold, openInMemoryRelayDatabase, openRelayDatabase, POSTGRES_LOCK_TIMEOUT_MS } =
|
||||
await import('./database.js')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from './database.js'
|
||||
|
||||
const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL
|
||||
|
||||
@@ -3,7 +3,7 @@ import { RELAY_CLOSE_CODE } from '@orca-cloud/relay-contract'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type WebSocket from 'ws'
|
||||
import { z } from 'zod'
|
||||
import type { RelayAssignmentStore } from './assignment-store.js'
|
||||
import type { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { CELL_FLAG_DEFAULTS, type CellFlags } from './cell-flags.js'
|
||||
import type { RelayConfig } from './config.js'
|
||||
import type { RelayCredentialStore } from './credential-store.js'
|
||||
|
||||
@@ -16,7 +16,7 @@ vi.mock('./relay-token-verifier.js', () => ({
|
||||
}))
|
||||
|
||||
import { createRelayApp } from './app.js'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { CellReserveClient } from './cell-reserve-client.js'
|
||||
import { openInMemoryRelayDatabase, type RelayDatabase } from './database.js'
|
||||
import { ReserveAssignment, type ReservePlacementMode } from './reserve-assignment.js'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterEach, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { RelayCellConfig } from './config.js'
|
||||
import { openInMemoryRelayDatabase, type RelayDatabase } from './database.js'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import pg from 'pg'
|
||||
import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { RelayConfig } from './config.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from './database.js'
|
||||
import { createRelayServer } from './relay-server.js'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
||||
import type { RelayCellConfig } from './config.js'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import {
|
||||
openInMemoryRelayDatabase,
|
||||
type RelayDatabase,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { EventEmitter } from 'node:events'
|
||||
import { ASSIGNMENT_LIMITS, RELAY_CLOSE_CODE } from '@orca-cloud/relay-contract'
|
||||
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type WebSocket from 'ws'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { CONTROL_RENEWAL_BATCH_INTERVAL_MS } from './control-renewal-batch.js'
|
||||
import type { RelayConfig } from './config.js'
|
||||
import type { RelayCredentialStore } from './credential-store.js'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from './database.js'
|
||||
|
||||
const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract'
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { ControlRenewalOutcome } from './control-renewal-statement.js'
|
||||
import {
|
||||
openInMemoryRelayDatabase,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { performance } from 'node:perf_hooks'
|
||||
import { ASSIGNMENT_LIMITS, RELAY_PROTOCOL_LIMITS } from '@orca-cloud/relay-contract'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { CONTROL_RENEWAL_BATCH_SQL } from './control-renewal-statement.js'
|
||||
import {
|
||||
openRelayDatabase,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterEach, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { RelayCellConfig } from './config.js'
|
||||
import {
|
||||
openInMemoryRelayDatabase,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import pg from 'pg'
|
||||
import { afterAll, afterEach, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { RelayCellConfig } from './config.js'
|
||||
import {
|
||||
openInMemoryRelayDatabase,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract'
|
||||
import { afterEach, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { openInMemoryRelayDatabase, type RelayDatabase, type SqlRow } from './database.js'
|
||||
|
||||
let database: RelayDatabase | undefined
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createHash } from 'node:crypto'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentRowBusyError, RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentRowBusyError, RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import {
|
||||
encodeMembership,
|
||||
type CellAdmissionMembership,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { EventEmitter } from 'node:events'
|
||||
import { RELAY_CLOSE_CODE, RELAY_PROTOCOL_LIMITS } from '@orca-cloud/relay-contract'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type WebSocket from 'ws'
|
||||
import type { RelayAssignmentStore } from './assignment-store.js'
|
||||
import type { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { RelayConfig } from './config.js'
|
||||
import type { CredentialReservation, RelayCredentialStore } from './credential-store.js'
|
||||
import {
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
import nacl from 'tweetnacl'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import type WebSocket from 'ws'
|
||||
import type { RelayAssignmentStore } from './assignment-store.js'
|
||||
import type { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { CellReserveBook } from './cell-reserve-book.js'
|
||||
import type { RelayConfig } from './config.js'
|
||||
import type { RelayCredentialStore } from './credential-store.js'
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
} from '@orca-cloud/relay-contract'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi, type MockInstance } from 'vitest'
|
||||
import type WebSocket from 'ws'
|
||||
import type { RelayAssignmentStore } from './assignment-store.js'
|
||||
import type { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { RelayConfig } from './config.js'
|
||||
import { RelayStoreError, type RelayCredentialStore } from './credential-store.js'
|
||||
import { CONTROL_RENEWAL_BATCH_INTERVAL_MS } from './control-renewal-batch.js'
|
||||
|
||||
@@ -32,7 +32,7 @@ import type { RawData } from 'ws'
|
||||
import type { RelayConfig } from './config.js'
|
||||
import type { AssignmentLeaseClass } from './assignment/assignment-lease.js'
|
||||
import type { AssignmentLeaseShadow } from './assignment/assignment-lease-shadow.js'
|
||||
import type { RelayAssignmentStore } from './assignment-store.js'
|
||||
import type { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { CellAdmitMode, CellReserveBook } from './cell-reserve-book.js'
|
||||
import type { DemoteRequest, ReserveOutcome, ReserveRequest } from './cell-reserve-contract.js'
|
||||
import { SeatDriftConfirmation, unbackedSeatReason, type UnbackedSeatReason } from './cell-seat-drift.js'
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
} from '@orca-cloud/relay-contract'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type WebSocket from 'ws'
|
||||
import type { RelayAssignmentStore } from './assignment-store.js'
|
||||
import type { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { RelayConfig } from './config.js'
|
||||
import type { RelayCredentialStore } from './credential-store.js'
|
||||
import { HostSessionRegistry } from './host-session-registry.js'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import type { HostWhereaboutsRow } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import type { HostWhereaboutsRow } from './assignment/assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { RelayConfig } from './config.js'
|
||||
import { openInMemoryRelayDatabase } from './database.js'
|
||||
import { ShadowSeatDirectory } from './shadow-seat-directory.js'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { RelayDatabase } from './database.js'
|
||||
import { openIdleRehomeTestDatabase } from './idle-regional-rehome-test-database.js'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { RelayDatabase, RelayLockOptions } from './database.js'
|
||||
import { openIdleRehomeTestDatabase } from './idle-regional-rehome-test-database.js'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { RelayDatabase } from './database.js'
|
||||
import { openIdleRehomeTestDatabase } from './idle-regional-rehome-test-database.js'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import type { RelayAssignmentStore } from './assignment-store.js'
|
||||
import type { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { RelayConfig } from './config.js'
|
||||
import type { RegionalRehomeSafetySnapshot } from './relay-observability.js'
|
||||
import { startRegionalRehomeWorker } from './regional-rehome-worker.js'
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
readAssignmentInventorySnapshot
|
||||
} from './assignment/assignment-inventory-snapshot.js'
|
||||
import { readRegionCorrectionOutcomes } from './region-correction-outcomes.js'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { loadRelayConfig } from './config.js'
|
||||
import { startCellHeartbeat } from './cell-heartbeat-client.js'
|
||||
import {
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
RelayAssignmentStore,
|
||||
STRANDED_MIGRATION_ABANDON_MS,
|
||||
type RelayAssignmentMigration
|
||||
} from './assignment-store.js'
|
||||
} from './assignment/assignment-store.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from './database.js'
|
||||
import { readRegisteredMigrationInventory } from './registered-migration-inventory.js'
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
PLACEMENT_INTAKE_WINDOW_MS,
|
||||
PlacementLoadBand
|
||||
} from './placement-load-band.js'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { openInMemoryRelayDatabase } from './database.js'
|
||||
|
||||
function seededRandom(seed: number): () => number {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterAll, afterEach, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from './database.js'
|
||||
|
||||
const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from './database.js'
|
||||
import { readPostgresLockWaitSample } from './postgres-lock-wait-sample.js'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import {
|
||||
openRelayDatabase,
|
||||
type RelayDatabase,
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
RelayAssignmentRowBusyError,
|
||||
type RelayAssignment,
|
||||
type ResolvedRelayAssignment
|
||||
} from './assignment-store.js'
|
||||
} from './assignment/assignment-store.js'
|
||||
import type { RelayConfig } from './config.js'
|
||||
|
||||
const fakes = vi.hoisted(() => ({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import type { RelayAssignment } from './assignment-store.js'
|
||||
import type { RelayAssignment } from './assignment/assignment-store.js'
|
||||
import type { RelayConfig } from './config.js'
|
||||
|
||||
const fakes = vi.hoisted(() => ({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { RelayAssignmentRowBusyError, type RelayAssignment } from './assignment-store.js'
|
||||
import { RelayAssignmentRowBusyError, type RelayAssignment } from './assignment/assignment-store.js'
|
||||
import type { RelayConfig } from './config.js'
|
||||
import type { StickySlotSample } from './sticky-slot-statements.js'
|
||||
import {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { mkdtemp, rm } from 'node:fs/promises'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterEach, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from './database.js'
|
||||
|
||||
const identity = { userId: 'restart-test-user', relayHostId: 'abcdefghijklmnop' }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterEach, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { openInMemoryRelayDatabase, openRelayDatabase, type RelayDatabase } from './database.js'
|
||||
|
||||
const identity = { userId: 'region-correction-test-user', relayHostId: 'abcdefghijklmnop' }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from './database.js'
|
||||
import {
|
||||
REGIONAL_REHOME_RECONNECTS_PER_CELL_LIMIT,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { rehomeSourceRegionAllowed } from './idle-regional-rehome-selection.js'
|
||||
import { openIdleRehomeTestDatabase } from './idle-regional-rehome-test-database.js'
|
||||
import { REGIONAL_REHOME_POLL_SUMMARY_INTERVAL_MS } from './regional-rehome-poll-telemetry.js'
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
REGIONAL_REHOME_QUARANTINE_FAILURES,
|
||||
REGIONAL_REHOME_QUARANTINE_MS,
|
||||
REGIONAL_REHOME_REDRAIN_SEND_LIMIT
|
||||
} from './assignment-store.js'
|
||||
} from './assignment/assignment-store.js'
|
||||
import {
|
||||
openInMemoryRelayDatabase,
|
||||
type RelayDatabase,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import {
|
||||
consumeRelayCellInventoryHold,
|
||||
openRelayDatabase,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { openInMemoryRelayDatabase } from './database.js'
|
||||
import { REGIONAL_REHOME_SQL_FAILURES_PER_CELL_LIMIT } from './regional-rehome-safety.js'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import type { RelayAssignmentStore } from './assignment-store.js'
|
||||
import type { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { RelayConfig } from './config.js'
|
||||
import {
|
||||
combineRegionalRehomeSafety,
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
IdleRegionalRehomeResponseSchema,
|
||||
isGlobalIdleRegionalRehomeDeferral
|
||||
} from '@orca-cloud/relay-contract'
|
||||
import type { RelayAssignmentStore } from './assignment-store.js'
|
||||
import type { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { RelayConfig } from './config.js'
|
||||
import { googleMetadataIdentityToken } from './google-metadata-identity-token.js'
|
||||
import type { RegionalRehomeSafetySnapshot } from './relay-observability.js'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { monitorEventLoopDelay, performance } from 'node:perf_hooks'
|
||||
import { RELAY_REGION_METRIC_SEGMENTS, type RelayRegion } from '@orca-cloud/relay-contract'
|
||||
import type { ControlRenewalOutcome } from './assignment-store.js'
|
||||
import type { ControlRenewalOutcome } from './control-renewal-statement.js'
|
||||
import type { ControlRenewalFlush } from './control-renewal-batch.js'
|
||||
import type { CellInventoryHoldCounts } from './cell-inventory-hold-samples.js'
|
||||
import type { PostgresPoolPressureCounts } from './postgres-pool-pressure.js'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { RelayAssignmentStore, type RelayAssignment } from './assignment-store.js'
|
||||
import { RelayAssignmentStore, type RelayAssignment } from './assignment/assignment-store.js'
|
||||
import type { RelayCellConfig } from './config.js'
|
||||
import { openInMemoryRelayDatabase, type RelayDatabase } from './database.js'
|
||||
import { ReservePaceError } from './reserve-assignment.js'
|
||||
|
||||
@@ -26,7 +26,7 @@ import { defaultIntakePerSec, type CellFlags } from './cell-flags.js'
|
||||
import { CellReserveBook } from './cell-reserve-book.js'
|
||||
import type { DemoteRequest, ReserveRequest } from './cell-reserve-contract.js'
|
||||
import { AssignmentLeaseShadow } from './assignment/assignment-lease-shadow.js'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { RelayConfig } from './config.js'
|
||||
import { RelayCredentialStore } from './credential-store.js'
|
||||
import {
|
||||
|
||||
@@ -14,7 +14,7 @@ import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import WebSocket from 'ws'
|
||||
import type { RawData } from 'ws'
|
||||
import { assignmentLeaseKeyId } from './assignment/assignment-lease.js'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import {
|
||||
encodeMembership,
|
||||
type CellAdmissionMembership
|
||||
|
||||
@@ -3,7 +3,7 @@ import { afterAll, afterEach, describe, expect, it } from 'vitest'
|
||||
import {
|
||||
RelayAssignmentStore,
|
||||
RELEASED_CONTROL_RESERVATION_RETENTION_MS
|
||||
} from './assignment-store.js'
|
||||
} from './assignment/assignment-store.js'
|
||||
import {
|
||||
openInMemoryRelayDatabase,
|
||||
openRelayDatabase,
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
RELAY_REGIONS,
|
||||
type RelayRegion
|
||||
} from '@orca-cloud/relay-contract'
|
||||
import type { AssignOptions, RelayAssignment } from './assignment-store.js'
|
||||
import type { AssignOptions, RelayAssignment } from './assignment/assignment-store.js'
|
||||
import { CELL_RESERVE_TTL_MS } from './cell-reserve-contract.js'
|
||||
import type { CellReserveClient } from './cell-reserve-client.js'
|
||||
import { relayHostLogDigest } from './relay-host-log-digest.js'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { RELAY_CLOSE_CODE } from '@orca-cloud/relay-contract'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { openInMemoryRelayDatabase } from './database.js'
|
||||
import { hostCohortBucket } from './host-cohort-bucket.js'
|
||||
import {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { RelayRegion } from '@orca-cloud/relay-contract'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { CellReserveClient } from './cell-reserve-client.js'
|
||||
import type { RelayCellConfig, RelayConfig } from './config.js'
|
||||
import { openInMemoryRelayDatabase, type RelayDatabase } from './database.js'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { randomUUID } from 'node:crypto'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import type { RelayCellConfig } from './config.js'
|
||||
import { openRelayDatabase, type RelayDatabase } from './database.js'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import type { RelayAssignment } from './assignment-store.js'
|
||||
import type { RelayAssignment } from './assignment/assignment-store.js'
|
||||
import type { RelayConfig } from './config.js'
|
||||
import {
|
||||
classifyShadowSeat,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { RelayAssignmentStore } from './assignment-store.js'
|
||||
import { RelayAssignmentStore } from './assignment/assignment-store.js'
|
||||
import { openInMemoryRelayDatabase } from './database.js'
|
||||
import {
|
||||
SHADOW_SEAT_OUTRANK_SKEW_MS,
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
import nacl from 'tweetnacl'
|
||||
import { expect, vi, type Mock, type MockInstance } from 'vitest'
|
||||
import type WebSocket from 'ws'
|
||||
import { RelayAssignmentStore } from '../assignment-store.js'
|
||||
import { RelayAssignmentStore } from '../assignment/assignment-store.js'
|
||||
import { loadRelayConfig } from '../config.js'
|
||||
import { RelayCredentialStore } from '../credential-store.js'
|
||||
import type { RelayDatabase } from '../database.js'
|
||||
|
||||
@@ -29,6 +29,26 @@
|
||||
"types": "./dist/assignment-invariants.d.ts",
|
||||
"default": "./dist/assignment-invariants.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
"./package.json": "./package.json",
|
||||
"./admission-budgets": {
|
||||
"types": "./dist/admission-budgets.d.ts",
|
||||
"default": "./dist/admission-budgets.js"
|
||||
},
|
||||
"./idle-regional-rehome": {
|
||||
"types": "./dist/idle-regional-rehome.d.ts",
|
||||
"default": "./dist/idle-regional-rehome.js"
|
||||
},
|
||||
"./protocol-limits": {
|
||||
"types": "./dist/protocol-limits.d.ts",
|
||||
"default": "./dist/protocol-limits.js"
|
||||
},
|
||||
"./region-correction": {
|
||||
"types": "./dist/region-correction.d.ts",
|
||||
"default": "./dist/region-correction.js"
|
||||
},
|
||||
"./relay-regions": {
|
||||
"types": "./dist/relay-regions.d.ts",
|
||||
"default": "./dist/relay-regions.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20593,15 +20593,15 @@
|
||||
"invariant": "A single-cell capacity check reads only that cell while retaining snapshot freshness, incarnation, outstanding reservation and missing-limit policy; new placement retains the full fleet inventory.",
|
||||
"oracle": "With 32 capped cells, an existing active host stays on its pinned cell and reads one headroom row; new placement reads all 32. Missing, expired or prior-incarnation snapshots, capacity exhaustion and outstanding debt still refuse the active pinned host; an uncapped cell remains admissible.",
|
||||
"commands": [
|
||||
"ORCA_BACKGROUND_LAUNCH=1 pnpm --dir cloud/apps/relay exec vitest run ../../../cloud/apps/relay/src/assignment/assignment-headroom-scope.test.ts ../../../cloud/apps/relay/src/assignment/assignment-connection-headroom.test.ts ../../../cloud/apps/relay/src/assignment-store.test.ts ../../../cloud/apps/relay/src/assignment/assignment-store-lock-order.test.ts ../../../cloud/apps/relay/src/cell-inventory-lock-contention.test.ts ../../../cloud/apps/relay/src/assignment-isolated-cell-replacement.test.ts ../../../cloud/apps/relay/src/regional-rehome-target-selection.test.ts --silent=false"
|
||||
"ORCA_BACKGROUND_LAUNCH=1 pnpm --dir cloud/apps/relay exec vitest run ../../../cloud/apps/relay/src/assignment/assignment-headroom-scope.test.ts ../../../cloud/apps/relay/src/assignment/assignment-connection-headroom.test.ts ../../../cloud/apps/relay/src/assignment/assignment-store.test.ts ../../../cloud/apps/relay/src/assignment/assignment-store-lock-order.test.ts ../../../cloud/apps/relay/src/cell-inventory-lock-contention.test.ts ../../../cloud/apps/relay/src/assignment/assignment-isolated-cell-replacement.test.ts ../../../cloud/apps/relay/src/regional-rehome-target-selection.test.ts --silent=false"
|
||||
],
|
||||
"testFiles": [
|
||||
"cloud/apps/relay/src/assignment/assignment-headroom-scope.test.ts",
|
||||
"cloud/apps/relay/src/assignment/assignment-connection-headroom.test.ts",
|
||||
"cloud/apps/relay/src/assignment-store.test.ts",
|
||||
"cloud/apps/relay/src/assignment/assignment-store.test.ts",
|
||||
"cloud/apps/relay/src/assignment/assignment-store-lock-order.test.ts",
|
||||
"cloud/apps/relay/src/cell-inventory-lock-contention.test.ts",
|
||||
"cloud/apps/relay/src/assignment-isolated-cell-replacement.test.ts",
|
||||
"cloud/apps/relay/src/assignment/assignment-isolated-cell-replacement.test.ts",
|
||||
"cloud/apps/relay/src/regional-rehome-target-selection.test.ts"
|
||||
],
|
||||
"assertionRefs": [
|
||||
@@ -20622,6 +20622,7 @@
|
||||
"runner": "local",
|
||||
"platform": "macos",
|
||||
"command": "ORCA_BACKGROUND_LAUNCH=1 pnpm --dir cloud/apps/relay exec vitest run ../../../cloud/apps/relay/src/assignment/assignment-headroom-scope.test.ts ../../../cloud/apps/relay/src/assignment/assignment-connection-headroom.test.ts ../../../cloud/apps/relay/src/assignment-store.test.ts ../../../cloud/apps/relay/src/assignment/assignment-store-lock-order.test.ts ../../../cloud/apps/relay/src/cell-inventory-lock-contention.test.ts ../../../cloud/apps/relay/src/assignment-isolated-cell-replacement.test.ts ../../../cloud/apps/relay/src/regional-rehome-target-selection.test.ts --silent=false",
|
||||
"currentCommand": "ORCA_BACKGROUND_LAUNCH=1 pnpm --dir cloud/apps/relay exec vitest run ../../../cloud/apps/relay/src/assignment/assignment-headroom-scope.test.ts ../../../cloud/apps/relay/src/assignment/assignment-connection-headroom.test.ts ../../../cloud/apps/relay/src/assignment/assignment-store.test.ts ../../../cloud/apps/relay/src/assignment/assignment-store-lock-order.test.ts ../../../cloud/apps/relay/src/cell-inventory-lock-contention.test.ts ../../../cloud/apps/relay/src/assignment/assignment-isolated-cell-replacement.test.ts ../../../cloud/apps/relay/src/regional-rehome-target-selection.test.ts --silent=false",
|
||||
"result": "passed",
|
||||
"durationSeconds": 0.513,
|
||||
"summary": "189 tests across seven files passed; independent root rerun also passed189 tests. Relay typecheck passed separately."
|
||||
|
||||
Reference in New Issue
Block a user