# Copyright (C) 2020-present MongoDB, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the Server Side Public License, version 1, # as published by MongoDB, Inc. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # Server Side Public License for more details. # # You should have received a copy of the Server Side Public License # along with this program. If not, see # . # # As a special exception, the copyright holders give permission to link the # code of portions of this program with the OpenSSL library under certain # conditions as described in each individual source file and distribute # linked combinations including the program with the OpenSSL library. You # must comply with the Server Side Public License in all respects for # all of the code used other than as permitted herein. If you modify file(s) # with this exception, you may extend this exception to your version of the # file(s), but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. If you delete this # exception statement from all source files in the program, then also delete # it in the license file. # global: cpp_namespace: "mongo" cpp_includes: - "mongo/client/read_preference.h" - "mongo/db/feature_compatibility_version_parser.h" - "mongo/db/repl/tenant_migration_util.h" imports: - "mongo/client/read_preference_setting.idl" - "mongo/db/repl/replication_types.idl" - "mongo/db/repl/tenant_migration_pem_payload.idl" - "mongo/db/serverless/serverless_types.idl" - "mongo/db/basic_types.idl" enums: TenantMigrationDonorState: description: "The state of an in-progress tenant migration." type: string values: kUninitialized: "uninitialized" kAbortingIndexBuilds: "aborting index builds" kDataSync: "data sync" kBlocking: "blocking" kCommitted: "committed" kAborted: "aborted" TenantMigrationRecipientState: description: "The state of an tenant migration on recipient side." type: string values: # The odd order is for the sake of backward compatibility. kUninitialized: "uninitialized" kStarted: "started" kConsistent: "consistent" kDone: "done" kLearnedFilenames: "learned filenames" kCommitted: "committed" kAborted: "aborted" ShardMergeRecipientState: description: "The state of shard merge on recipient side." type: string values: kStarted: "started" kLearnedFilenames: "learned filenames" kConsistent: "consistent" kCommitted: "committed" kAborted: "aborted" structs: tenantMigrationDonorDocument: description: "Represents an in-progress tenant migration on the migration donor." strict: true fields: _id: type: uuid description: "Unique identifier for the tenant migration." cpp_name: id recipientConnectionString: type: string description: >- The URI string that the donor will utilize to create a connection with the recipient. validator: callback: "tenant_migration_util::validateConnectionString" readPreference: type: readPreference description: >- The read preference setting that the recipient will use to determine which node in the donor replica set to clone from. tenantId: type: string description: >- The tenantId for the migration, when protocol is 'multitenant migrations'. state: type: TenantMigrationDonorState description: "The state of the tenant migration." default: kUninitialized blockTimestamp: type: timestamp description: >- The timestamp at which writes and causal reads against the databases being migrated should start blocking. optional: true commitOrAbortOpTime: type: optime description: The opTime at which the donor's state document was set to 'committed' or 'aborted'. optional: true abortReason: type: object_owned description: "The error that caused the migration to abort." optional: true expireAt: type: date description: >- The wall-clock time at which the state machine document should be removed by the TTL monitor. optional: true donorCertificateForRecipient: description: >- The SSL certificate and private key that the donor should use to authenticate to the recipient. type: TenantMigrationPEMPayload # TODO (SERVER-54085): Remove server parameter tenantMigrationDisableX509Auth. optional: true recipientCertificateForDonor: description: >- The SSL certificate and private key that the recipient should use to authenticate to the donor. type: TenantMigrationPEMPayload # TODO (SERVER-54085): Remove server parameter tenantMigrationDisableX509Auth. optional: true startMigrationDonorTimestamp: type: timestamp optional: true description: >- Timestamp after all index builds for tenant are complete or aborted. Recipient must not start cloning/fetching oplog entries from the donor until this timestamp is majority committed. validator: callback: "tenant_migration_util::validateTimestampNotNull" migrationStart: type: date description: >- The wall-clock time at which the migration has started. optional: true protocol: description: "Which migration protocol to use." type: MigrationProtocol optional: true tenantIds: type: array optional: true description: "The tenants list for Shard Merge." tenantMigrationRecipientDocument: description: "Represents an in-progress tenant migration on the migration recipient." strict: true fields: _id: type: uuid description: "Unique identifier for the tenant migration." cpp_name: id donorConnectionString: type: string description: >- The URI string that the recipient will utilize to create a connection with the donor. validator: callback: "tenant_migration_util::validateConnectionString" tenantId: type: string description: "The tenantId for the migration." startMigrationDonorTimestamp: type: timestamp description: >- Timestamp after all index builds for tenant are complete or aborted. Recipient must not start cloning/fetching oplog entries from the donor until this timestamp is majority committed. validator: callback: "tenant_migration_util::validateTimestampNotNull" readPreference: type: readPreference description: >- The read preference setting that the recipient will use to determine which node in the donor replica set to clone from. protocol: description: "Which migration protocol to use." type: MigrationProtocol optional: true state: type: TenantMigrationRecipientState description: "The state of the tenant migration." default: kUninitialized expireAt: type: date description: >- The wall-clock time at which the state machine document should be removed by the TTL monitor. optional: true startApplyingDonorOpTime: description: >- Populated during data sync; the donor's operation time when the data cloning starts. type: optime optional: true startFetchingDonorOpTime: description: >- Populated during data sync; the donor's operation time of the last open transaction when the data cloning started. type: optime optional: true dataConsistentStopDonorOpTime: description: >- Populated during data sync; the donor's operation time when the data cloning finishes. type: optime optional: true rejectReadsBeforeTimestamp: description: >- Populated during data sync when the recipientSyncData with the returnAfterReachingTimestamp is received after data is consistent; the earliest timestamp at which reads are allowed on the recipient (corresponds to the donor's blockTimestamp). type: timestamp optional: true cloneFinishedRecipientOpTime: description: >- Populated during data sync; the recipient operation time when the data cloning finishes. type: optime optional: true recipientCertificateForDonor: description: >- The SSL certificate and private key that the recipient should use to authenticate to the donor. type: TenantMigrationPEMPayload # TODO (SERVER-54085): Remove server parameter tenantMigrationDisableX509Auth. optional: true recipientPrimaryStartingFCV: description: >- The featureCompatibilityVersion of the recipient as recorded at the beginning of a migration attempt. Implicitly includes information on current upgrade or downgrade state. type: fcv_string optional: true numRestartsDueToDonorConnectionFailure: description: >- A counter that is incremented on each restart due to a donor connection failure. type: long default: 0 # Not used but kept for parsing backwards compatibility with <= 6.2 which supports # recipient failover. numRestartsDueToRecipientFailure: description: >- A counter that is incremented on each restart due to a recipient failure. type: long default: 0 completedUpdatingTransactionsBeforeStartOpTime: description: >- Indicates if the recipient has finished updating transaction entries that were committed before 'startFetchingDonorOpTime'. If true, the recipient can skip the fetching transactions stage. type: bool default: false completedFetchingRetryableWritesBeforeStartOpTime: description: >- Indicates if the recipient has finished fetching retryable writes oplog entries before 'startFetchingDonorOpTime' for each retryable writes entry in 'config.transactions' type: bool default: false startAt: type: date description: >- The wall-clock time at which the state machine document is initialized. optional: true tenantIds: type: array optional: true description: "The tenants list for Shard Merge." abortOpTime: type: optime description: The opTime at which the donor's state document was set to 'aborted'. Only set for 'shard merge' when it goes into 'aborted' state. optional: true ShardMergeRecipientDocument: description: "Represents an in-progress shard merge on the merge recipient." strict: true fields: _id: type: uuid description: "Unique identifier for the shard merge." cpp_name: id donorConnectionString: type: string description: >- The URI string that the recipient will utilize to create a connection with the donor. validator: callback: "tenant_migration_util::validateConnectionString" tenantIds: type: array description: "List of tenants to be migrated." startMigrationDonorTimestamp: type: timestamp description: >- Timestamp after all index builds for tenant are complete or aborted. Recipient must not start cloning/fetching oplog entries from the donor until this timestamp is majority committed. validator: callback: "tenant_migration_util::validateTimestampNotNull" readPreference: type: readPreference description: >- The read preference setting that the recipient will use to determine which node in the donor replica set to clone from. state: type: ShardMergeRecipientState description: "The state of the shard merge recipient" default: kStarted expireAt: type: date description: >- The wall-clock time at which the state machine document should be removed. optional: true startApplyingDonorOpTime: description: >- Populated during migration; the donor's operation time when the data cloning starts. type: optime optional: true startFetchingDonorOpTime: description: >- Populated during migration; the donor's operation time of the last open transaction when the data cloning started. type: optime optional: true rejectReadsBeforeTimestamp: description: >- Populated during migration when the recipientSyncData with the returnAfterReachingTimestamp is received after data is consistent; the earliest timestamp at which reads are allowed on the recipient (corresponds to the donor's blockTimestamp). type: timestamp optional: true cloneFinishedRecipientOpTime: description: >- Populated during migration; the recipient operation time when the data cloning finishes. type: optime optional: true recipientCertificateForDonor: description: >- The SSL certificate and private key that the recipient should use to authenticate to the donor. type: TenantMigrationPEMPayload # TODO (SERVER-54085): Remove server parameter tenantMigrationDisableX509Auth. optional: true completedUpdatingTransactionsBeforeStartOpTime: description: >- Indicates if the recipient has finished updating transaction entries that were committed before 'startFetchingDonorOpTime'. If true, the recipient can skip the fetching transactions stage. type: bool default: false completedFetchingRetryableWritesBeforeStartOpTime: description: >- Indicates if the recipient has finished fetching retryable writes oplog entries before 'startFetchingDonorOpTime' for each retryable writes entry in 'config.transactions' type: bool default: false startAt: type: date description: >- The wall-clock time at which the state machine document is initialized. optional: true startGarbageCollect: type: bool description: >- Indicates if migration needs to be skipped. If true, the recipient state machine will skip migration and waits for migration decision directly. default: false abortOpTime: type: optime description: The opTime at which the donor's state document was set to 'aborted'. optional: true