Conversation
Add the cross data center (DC-DR) status surface to the distributed MSSQLServer object, mirroring the Postgres DC-DR status shape and adding the Distributed Availability Group (DAG) specific telemetry. status.disasterRecovery carries the active DC, the DR phase, and a per data center view (each Member DC's AG primary, DAG role, writability, DAG synchronization health, redo and log-send queue bytes, and last hardened LSN) so the single distributed MSSQLServer object reflects the per-DC state owned by the dr-controlplane primary-DC Lease. CRD and openapi regeneration is a follow-up mechanical step. Signed-off-by: Tamal Saha <tamal@appscode.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the cross data center (DC-DR) status surface to the distributed
MSSQLServerobject, the foundational apimachinery piece for KubeDB MSSQL DC-DR (dc-dr/mssqlserver/common.md). It mirrors the Postgres DC-DR status shape and adds the Distributed Availability Group (DAG) specific telemetry that MSSQL needs.Types added (
apis/kubedb/v1alpha2/mssqlserver_types.go)MSSQLServerStatus.disasterRecovery *MSSQLServerDisasterRecoveryStatusMSSQLServerDRPhase(Steady,FailingOver,FailingBack,Degraded)MSSQLServerDisasterRecoveryStatus:activeDC,phase,dataCenters[],lastTransitionTimeMSSQLServerDCStatus: per Member DC view,clusterName,role,agPrimary,dagRole,writable,synchronizationHealth,redoQueueBytes,logSendQueueBytes,lastHardenedLSN,healthyThe cross-DC decision is owned by the
dr-controlplaneprimary-DC Lease, which drives the underlying DAG role; this status reflects it on the single distributedMSSQLServerobject. The DAG-specific fields (synchronizationHealth,redoQueueBytes,logSendQueueBytes,lastHardenedLSN) are sourced fromsys.dm_hadr_database_replica_statesand back the lag guard and the LSN-equality switchover gate.zz_generated.deepcopy.gois updated by hand to match.Staging
This is step 1 of the staging order in
dc-dr/mssqlserver/common.md: apimachinery merges and releases first, then the mssqlserver operator and mssql-coordinator bump to it.Follow-up
CRD and openapi regeneration is a mechanical follow-up step (matches the Postgres DC-DR PR, which also deferred regen to a separate mechanical pass).
Test plan
go build ./apis/kubedb/...go vet ./apis/kubedb/v1alpha2/gofmtclean