Skip to content

Add MSSQLServer cross-DC disaster recovery (DC-DR) guide#942

Open
tamalsaha wants to merge 2 commits into
masterfrom
mssqlserver-dc-dr-docs
Open

Add MSSQLServer cross-DC disaster recovery (DC-DR) guide#942
tamalsaha wants to merge 2 commits into
masterfrom
mssqlserver-dc-dr-docs

Conversation

@tamalsaha

@tamalsaha tamalsaha commented Jun 30, 2026

Copy link
Copy Markdown
Member

What

Adds the cross data center disaster recovery (DC-DR) documentation section for KubeDB MSSQLServer, mirroring the Camp-2 (Lease-leads) DC-DR doc structure used by the other engines.

New files under docs/guides/mssqlserver/dr/:

  • _index.md (section index)
  • overview/index.md (architecture, the AG-never-crosses-a-DC rule, DC roles, 2-DC vs 3-DC topology, deploy, status.disasterRecovery, failover, switchover)
  • guide/index.md (components, the DC-name contract, the fail-closed fence, lag, the timing invariant, per-DC scaling, DC-aware health, day-2 ops)
  • runbook/index.md (scenario-by-scenario procedures)

Also appends a ## Cross-DC Disaster Recovery (DC-DR) section to docs/guides/mssqlserver/README.md linking the overview.

Engine adaptation (MySQL Group Replication -> SQL Server)

  • Intra-DC HA is an Always On Availability Group (CLUSTER_TYPE = EXTERNAL, SYNCHRONOUS_COMMIT) driven by the raft-based mssql-coordinator; the AG and its raft are strictly intra-DC.
  • Cross-DC link is the native Distributed AG (DAG), ASYNCHRONOUS_COMMIT over the DB-mirroring endpoint on port 5022; the standby DC's AG is the DAG secondary (forwarder) and auto-seeds via SEEDING_MODE = AUTOMATIC (no backup/restore step).
  • The fence forces a non-active DC's AG to the DAG SECONDARY role, keeps its AG primary labeled standby, and fails closed on lost marker contact (ConfigMap primary-dc, ns dc-failover, keys activeDC/renewTime, 30s TTL).
  • Failover T-SQL: planned switches the DAG to SYNCHRONOUS_COMMIT, gates on last_hardened_lsn equality, SET (ROLE = SECONDARY) on the old AG, graceful FORCE_FAILOVER_ALLOW_DATA_LOSS on the new AG; unplanned force-fails over the survivor (bounded loss = un-shipped redo).
  • Lag telemetry from sys.dm_hadr_database_replica_states; status.disasterRecovery uses the new fields activeDC, phase, and dataCenters[] with clusterName/role/agPrimary/dagRole/writable/synchronizationHealth/redoQueueBytes/logSendQueueBytes/lastHardenedLSN/healthy.
  • Planned switchover trigger is the CR annotation dr.kubedb.com/switchover-to: <dc> (no Switchover OpsRequest type). DC-DR enable trigger is dr.kubedb.com/enabled=true.
  • Topology is two data DCs plus one data-less Arbiter DC; a native DAG joins exactly two AGs, so 3+ data DCs (chained DAGs) are called out as out of scope.

Notes / assumptions

  • CR examples use apiVersion: kubedb.com/v1alpha2, kind: MSSQLServer, topology.mode: DistributedAG (matching the existing AG/DAG clustering examples). The distributed DC-DR spec fields (spec.distributed, podPlacementPolicy, the PlacementPolicy clusterSpreadConstraint.failoverPolicy / distributionRules) follow the MySQL DC-DR doc pattern, since the one-CR distributed expansion is the headline implementation item still being built.

Summary by CodeRabbit

  • Documentation
    • Added a new cross–data center disaster recovery guide for MSSQLServer, including DC-DR architecture, configuration/placement guidance, failover/switchover behavior, scaling, observability, limitations, and cleanup.
    • Added an overview page and a detailed runbook with scenario-based procedures and an escalation checklist.
    • Expanded the main MSSQLServer documentation with a new DC-DR section and reordered the contribution guidance for improved readability.

Document cross data center disaster recovery for distributed MSSQLServer,
mirroring the Camp-2 (Lease-leads) DC-DR doc structure used by the other
engines. SQL Server is the closest native fit because Always On Distributed
Availability Groups already provide a cross-cluster geo-DR link.

Adaptation from the MySQL Group Replication model to the SQL Server engine:

- Intra-DC HA is an Always On Availability Group (CLUSTER_TYPE = EXTERNAL)
  with SYNCHRONOUS_COMMIT replicas, driven by the raft-based mssql-coordinator
  that labels pods primary/secondary. The AG and its coordinator raft are
  strictly intra-DC.
- The cross-DC link is the native Distributed Availability Group (DAG),
  ASYNCHRONOUS_COMMIT over the DB-mirroring endpoint on port 5022, with the
  standby DC's AG as the DAG secondary (forwarder) auto-seeding via
  SEEDING_MODE = AUTOMATIC. No backup/restore seeding step.
- The fail-closed fence forces a non-active DC's AG to the DAG SECONDARY role
  and keeps its AG primary labeled standby. Marker contract: ConfigMap
  primary-dc in namespace dc-failover, keys activeDC/renewTime, 30s TTL.
- Failover T-SQL: planned switches the DAG to SYNCHRONOUS_COMMIT, gates on
  last_hardened_lsn equality, SET (ROLE = SECONDARY) on the old AG and a
  graceful FORCE_FAILOVER_ALLOW_DATA_LOSS on the new AG; unplanned force-fails
  over the survivor with bounded loss (un-shipped redo).
- Lag telemetry from sys.dm_hadr_database_replica_states
  (synchronization_health, redo_queue_size, log_send_queue_size,
  last_hardened_lsn) surfaced in status.disasterRecovery.
- Topology is two data DCs (each a self-contained AG) plus one data-less
  Arbiter DC; a native DAG joins exactly two AGs, so three or more data DCs
  (chained DAGs) are out of scope.

Adds docs/guides/mssqlserver/dr/{_index,overview,guide,runbook} and links the
section from the MSSQLServer README.

Signed-off-by: Tamal Saha <tamal@appscode.com>
kodiak-appscode[bot]
kodiak-appscode Bot previously approved these changes Jun 30, 2026
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 940409b5-c53a-428f-b3a9-be4efc0f2c2f

📥 Commits

Reviewing files that changed from the base of the PR and between cc55655 and 59978aa.

📒 Files selected for processing (1)
  • docs/guides/mssqlserver/README.md
✅ Files skipped from review due to trivial changes (1)
  • docs/guides/mssqlserver/README.md

📝 Walkthrough

Walkthrough

This PR adds MSSQLServer cross-data-center disaster recovery documentation: a new DR section in the guide navigation, an overview page, a detailed user guide, an operational runbook, and a README link to the new material.

Changes

DC-DR Documentation Addition

Layer / File(s) Summary
README link and DR section index
docs/guides/mssqlserver/README.md, docs/guides/mssqlserver/dr/_index.md
Adds a Cross-DC Disaster Recovery section to the README linking to the new guide, and adds front matter/menu metadata for the new DR documentation section.
DC-DR conceptual overview and quick start
docs/guides/mssqlserver/dr/overview/index.md
Adds the overview page covering the DC-DR model, roles, topologies, prerequisites, quick-start manifests, status observability, failover/switchover, scaling, and cleanup.
DC-DR detailed user guide
docs/guides/mssqlserver/dr/guide/index.md
Adds the detailed guide covering architecture, contracts, operator flags, examples, connectivity/observability, replication/RPO timing, switchover/failback, scaling, day-2 ops, and limitations.
DC-DR operational runbook
docs/guides/mssqlserver/dr/runbook/index.md
Adds the runbook with quick reference, golden rules, scenario-by-scenario procedures, and an escalation checklist.

Estimated code review effort: 2 (Simple) | ~15 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding MSSQLServer cross-DC disaster recovery documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mssqlserver-dc-dr-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (31)
docs/guides/mssqlserver/dr/overview/index.md (2)

39-39: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use descriptive link text.

"here" is non-descriptive link text. Reword to describe the destination.

- > **New to KubeDB?** Please start [here](/docs/README.md).
+ > **New to KubeDB?** Please start with the [KubeDB introduction](/docs/README.md).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/overview/index.md` at line 39, The link text in
this markdown callout is non-descriptive, so update it to clearly describe the
destination instead of using “here.” Edit the existing link in the overview
content to use a meaningful label that points to the same /docs/README.md
target, keeping the surrounding “New to KubeDB?” sentence intact.

174-178: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Specify language for the fenced code block.

The operator flags code block lacks a language identifier. Add text or bash to satisfy Markdown linting and improve rendering.

  • text
    --dc-dr-enabled

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @docs/guides/mssqlserver/dr/overview/index.md around lines 174 - 178, The
fenced operator flags block is missing a language identifier, which triggers
Markdown linting issues. Update the code fence in the overview guide to specify
a language such as text or bash so the block renders correctly; this is the
block containing the --dc-dr-enabled, --dc-dr-coord-kubeconfig, and
--dc-dr-local-dc flags.


</details>

<!-- cr-comment:v1:02104a8849b4b81c07dbba55 -->

</blockquote></details>
<details>
<summary>docs/guides/mssqlserver/dr/guide/index.md (9)</summary><blockquote>

`43-48`: _📐 Maintainability & Code Quality_ | _🔵 Trivial_ | _⚡ Quick win_

**Specify language for fenced code block.**

The ConfigMap example block lacks a language specifier.




```diff
- ```
+ ```yaml
  ConfigMap primary-dc  (namespace: dc-failover, on each spoke)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/guide/index.md` around lines 43 - 48, The fenced
example in the guide is missing a language specifier, so update the ConfigMap
snippet to use a YAML code fence. Locate the documentation block around the
primary-dc ConfigMap example and change the opening fence to include the proper
language tag while keeping the example content unchanged.

24-24: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add descriptive link text.

"here" is not descriptive link text. Use something like "the KubeDB getting started guide" instead.

- > **New to KubeDB?** Please start [here](/docs/README.md).
+ > **New to KubeDB?** Please start [the KubeDB getting started guide](/docs/README.md).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/guide/index.md` at line 24, The markdown link text
in the introductory callout is too generic and should be made descriptive.
Update the link in the opening “New to KubeDB?” sentence to use meaningful
anchor text, such as “the KubeDB getting started guide,” so the target is clear
without relying on “here.”

195-196: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove dollar sign prefix or show output.

The command shows a dollar sign without output, which breaks copy-paste and contradicts markdown lint rules.

- $ kubectl get mssqlserver -n demo mssql-dcdr -o jsonpath='{.status.disasterRecovery}' | jq
+ kubectl get mssqlserver -n demo mssql-dcdr -o jsonpath='{.status.disasterRecovery}' | jq
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/guide/index.md` around lines 195 - 196, The
markdown example in the disaster recovery guide has a shell prompt without the
corresponding command output, which breaks copy-paste formatting. Update the
example around the kubectl/jsonpath snippet to either remove the leading dollar
sign from the command or include the expected output block, keeping the fenced
code section consistent with the other examples in the guide.

327-329: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Clarify "SQL Server analog of a re-seed."

The parenthetical "(the SQL Server analog of a re-seed, not a transparent rejoin)" is confusing. DAG automatic seeding is the SQL Server mechanism—there's no "analog" involved. Rephrase for clarity.

- re-seed them over 5022 (the SQL Server analog of a re-seed, not a transparent
+ re-seed them over 5022 (automatic seeding, not a transparent
    rejoin).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/guide/index.md` around lines 327 - 329, The
parenthetical in the DR guide is confusing because it describes DAG automatic
seeding as an “analog” rather than the actual SQL Server mechanism. Update the
wording in the affected paragraph to refer directly to automatic seeding and
remove the “analog of a re-seed, not a transparent rejoin” phrasing. Keep the
explanation aligned with the surrounding discussion of the AG removal, automatic
seeding, and catch-up flow.

300-301: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove dollar sign prefix or show output.

The command shows a dollar sign without output.

- $ kubectl annotate mssqlserver -n demo mssql-dcdr dr.kubedb.com/switchover-to=dc-west
+ kubectl annotate mssqlserver -n demo mssql-dcdr dr.kubedb.com/switchover-to=dc-west
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/guide/index.md` around lines 300 - 301, The
command example in the MSSQLServer DR guide is showing a shell prompt without
any accompanying output, so update the example to either remove the leading
dollar sign or include the command output. Locate the kubectl annotate example
in the DR guide content and make the snippet consistent with the surrounding
documentation style.

68-72: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Specify language for fenced code block.

The operator flags block lacks a language specifier.

- ```
+ ```bash
  --dc-dr-enabled
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/guide/index.md` around lines 68 - 72, The fenced
flags block in the MSSQL Server DR guide is missing a language specifier; update
the markdown snippet to use a bash-labeled code fence for the operator flags
example. Locate the fenced block containing the --dc-dr-enabled,
--dc-dr-coord-kubeconfig, and --dc-dr-local-dc flags in the guide content and
add the appropriate language tag while keeping the existing flag lines
unchanged.

391-392: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove dollar sign prefix or show output.

The command shows a dollar sign without output.

- $ kubectl delete mssqlserver -n demo mssql-dcdr
+ kubectl delete mssqlserver -n demo mssql-dcdr
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/guide/index.md` around lines 391 - 392, The
example command in the MSSQL Server DR guide is showing a shell prompt marker
without any accompanying output, which makes the snippet look incomplete. Update
the relevant command block to either remove the leading dollar sign or add the
expected command output after the command, and keep the example consistent with
the surrounding markdown code samples.

321-322: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove dollar sign prefix or show output.

The command shows a dollar sign without output.

- $ kubectl annotate mssqlserver -n demo mssql-dcdr dr.kubedb.com/switchover-to=dc-east
+ kubectl annotate mssqlserver -n demo mssql-dcdr dr.kubedb.com/switchover-to=dc-east
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/guide/index.md` around lines 321 - 322, The
example command in the MSSQLServer DR guide is shown with a dollar-sign prompt
but no accompanying output, so update the snippet to either remove the prompt
prefix or add the expected output/continuation for the kubectl annotate example.
Adjust the markdown example near the switchover command so it matches the
surrounding documentation style and does not present a standalone shell prompt.

244-246: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Clarify "last un-shipped redo" phrasing.

"un-shipped redo" is imprecise—redo is applied, not shipped. The RPO loss is un-shipped transaction log (log records not yet sent to the standby). Consider "un-replicated log" or "un-shipped log" for accuracy.

- An **unplanned failover** may lose the last un-shipped redo (bounded by the
+ An **unplanned failover** may lose the last un-replicated transaction log (bounded by the
    standby's lag at the moment the active DC died).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/guide/index.md` around lines 244 - 246, The phrase
“last un-shipped redo” in the failover description is imprecise and should be
replaced with terminology that matches SQL Server replication semantics. Update
the wording in the DR guide text to refer to un-shipped or un-replicated
transaction log/log records instead of redo, keeping the rest of the explanation
intact and consistent with the surrounding `SYNCHRONOUS_COMMIT` and
`last_hardened_lsn` discussion.
docs/guides/mssqlserver/dr/runbook/index.md (20)

19-22: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add descriptive link text.

"User Guide" is somewhat descriptive but could be more specific. Consider "the DC-DR User Guide for concepts and commands."

- Read the [User Guide](/docs/guides/mssqlserver/dr/guide/index.md) for the concepts and
+ Read the [DC-DR User Guide](/docs/guides/mssqlserver/dr/guide/index.md) for the concepts and
  commands referenced here.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/runbook/index.md` around lines 19 - 22, The link
text in the runbook intro should be more specific than “User Guide”; update the
reference in the markdown near the opening guidance to use descriptive text that
identifies it as the DC-DR User Guide for concepts and commands, while keeping
the existing target unchanged.

144-145: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add output example or remove dollar signs.

Command uses dollar sign without output.

- $ kubectl get mssqlserver -n demo mssql-dcdr -o jsonpath='{range .status.disasterRecovery.dataCenters[?(@.writable==true)]}{.clusterName}{end}'
+ kubectl get mssqlserver -n demo mssql-dcdr -o jsonpath='{range .status.disasterRecovery.dataCenters[?(@.writable==true)]}{.clusterName}{end}'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/runbook/index.md` around lines 144 - 145, The
runbook command example includes shell prompt dollar signs without showing any
corresponding output, so either remove the dollar signs from the command snippet
or add an example output block after the command. Update the affected
documentation around the kubectl get mssqlserver example so the formatting is
consistent and the command is clearly presented.

100-101: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add output example or remove dollar signs.

Command uses dollar sign without output.

- $ kubectl annotate mssqlserver -n demo mssql-dcdr dr.kubedb.com/switchover-to=dc-west
+ kubectl annotate mssqlserver -n demo mssql-dcdr dr.kubedb.com/switchover-to=dc-west
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/runbook/index.md` around lines 100 - 101, The
runbook command example in the MSSQL Server DR guide uses shell prompt dollar
signs without showing terminal output, so either remove the dollar signs or add
a matching output example for the command. Update the example around the kubectl
annotate command so it is consistent with the surrounding documentation style.

86-87: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add output example or remove dollar signs.

Command uses dollar sign without output.

- $ kubectl get mssqlserver -n demo mssql-dcdr -o jsonpath='{range .status.disasterRecovery.dataCenters[*]}{.clusterName}={.writable} {end}'
+ kubectl get mssqlserver -n demo mssql-dcdr -o jsonpath='{range .status.disasterRecovery.dataCenters[*]}{.clusterName}={.writable} {end}'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/runbook/index.md` around lines 86 - 87, The
runbook command example includes a shell prompt indicator without showing any
output, which makes the snippet inconsistent; update the example in the relevant
documentation section to either remove the dollar sign or add a matching output
example. Use the kubectl jsonpath command shown in the disaster recovery guide
to locate the snippet and keep the formatting consistent with the surrounding
examples.

112-114: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add output example or remove dollar signs.

Commands use dollar signs without output.

- $ kubectl get mssqlserver -n demo mssql-dcdr -o jsonpath='{.status.disasterRecovery.activeDC}'  # dc-west
+ kubectl get mssqlserver -n demo mssql-dcdr -o jsonpath='{.status.disasterRecovery.activeDC}'  # dc-west

(Apply to both lines 112-113)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/runbook/index.md` around lines 112 - 114, The
example commands in the runbook use shell prompt markers without showing any
corresponding output, so either remove the dollar signs or add explicit output
examples for both kubectl get mssqlserver jsonpath commands in the
disasterRecovery section. Update the nearby documentation snippet that
references activeDC and phase so the formatting is consistent with the rest of
the guide.

206-209: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add output example or remove dollar signs.

Command uses dollar sign without output.

- $ kubectl get mssqlserver -n demo mssql-dcdr -o jsonpath='{range .status.disasterRecovery.dataCenters[*]}{.clusterName} redo={.redoQueueBytes} send={.logSendQueueBytes} sync={.synchronizationHealth} healthy={.healthy}{"\n"}{end}'
+ kubectl get mssqlserver -n demo mssql-dcdr -o jsonpath='{range .status.disasterRecovery.dataCenters[*]}{.clusterName} redo={.redoQueueBytes} send={.logSendQueueBytes} sync={.synchronizationHealth} healthy={.healthy}{"\n"}{end}'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/runbook/index.md` around lines 206 - 209, The
kubectl example in the disaster recovery runbook uses shell-style command
formatting without showing any output, so either add a representative output
example for the jsonpath command or remove any dollar-sign prompt styling if
present elsewhere in the section. Update the documentation around the kubectl
get mssqlserver command to make the example self-explanatory and consistent with
the surrounding runbook examples.

213-220: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Clarify "then" usage in cause/action bullets.

Same grammatical issue with "then" in bullets. Use colons or rephrase.

- - **LSN equality never reached** then the DAG must be `SYNCHRONOUS_COMMIT` for the target to
+ - **LSN equality never reached:** the DAG must be `SYNCHRONOUS_COMMIT` for the target to

(Apply similar fixes to lines 216, 219, 221)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/runbook/index.md` around lines 213 - 220, Rephrase
the cause/action bullets in the runbook section to remove the awkward “then”
construction by using a colon or equivalent clearer phrasing; update the
affected bullet text in the switchover guidance so the condition and the
follow-up action read naturally and consistently, especially in the entries
describing LSN equality, target health/no lag, and target being too far behind.

125-126: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add output example or remove dollar signs.

Command uses dollar sign without output.

- $ kubectl annotate mssqlserver -n demo mssql-dcdr dr.kubedb.com/switchover-to=dc-east
+ kubectl annotate mssqlserver -n demo mssql-dcdr dr.kubedb.com/switchover-to=dc-east
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/runbook/index.md` around lines 125 - 126, The
command example includes a shell prompt marker without showing the resulting
output, so either add a matching output example for the kubectl annotate command
or remove the dollar-sign prompt styling from the runbook snippet. Update the
affected example in the DR runbook so the formatting is consistent with the rest
of the markdown and clearly reflects the intended usage of kubectl annotate.

359-363: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add output example or remove dollar signs.

Commands use dollar signs without output.

- $ kubectl get mssqlserver -n demo mssql-dcdr -o yaml
+ kubectl get mssqlserver -n demo mssql-dcdr -o yaml

(Apply to all lines 359-363)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/runbook/index.md` around lines 359 - 363, The
runbook command examples include shell prompts without showing any corresponding
output, so either remove the leading dollar signs or add matching output
examples for the commands in this block. Update the markdown in the runbook
section that includes kubectl get mssqlserver, kubectl --kubeconfig, kubectl get
configmap, kubectl get pods, and kubectl logs so the examples are consistent and
copyable.

286-287: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add output example or remove dollar signs.

Command uses dollar sign without output.

- $ kubectl get mssqlserver -n demo mssql-dcdr -o jsonpath='{range .status.disasterRecovery.dataCenters[*]}{.clusterName} healthy={.healthy} sync={.synchronizationHealth} redo={.redoQueueBytes}{"\n"}{end}'
+ kubectl get mssqlserver -n demo mssql-dcdr -o jsonpath='{range .status.disasterRecovery.dataCenters[*]}{.clusterName} healthy={.healthy} sync={.synchronizationHealth} redo={.redoQueueBytes}{"\n"}{end}'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/runbook/index.md` around lines 286 - 287, The
runbook command example includes a shell prompt-style dollar sign but does not
show any corresponding output, so update the nearby documentation in the
disaster recovery section to either remove the dollar sign from the command or
add a matching output example. Keep the fix focused on the kubectl get
mssqlserver jsonpath example so the formatting is consistent with the rest of
the guide.

222-222: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add output example or remove dollar sign.

Command uses dollar sign without output.

-   `kubectl annotate mssqlserver -n demo mssql-dcdr dr.kubedb.com/switchover-to-`.
+   `kubectl annotate mssqlserver -n demo mssql-dcdr dr.kubedb.com/switchover-to-`.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/runbook/index.md` at line 222, The kubectl
annotate command example in the runbook is missing a proper shell prompt or
output context, so either add an output example for the command or remove the
leading dollar-sign style from the snippet. Update the example around the
kubectl annotate mssqlserver invocation so it is consistent with the surrounding
docs formatting and clearly indicates whether it is a command or output.

188-195: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Clarify "then" usage in cause/action bullets.

The "then" construction in "Lease did not move then" and "No quorum in the survivor then" is grammatically awkward. Use colon or rephrase for clarity.

- - **Lease did not move** then only Member DCs are eligible; confirm the survivor is a `Member`
+ - **Lease did not move:** only Member DCs are eligible; confirm the survivor is a `Member`

(Apply similar fix to line 191)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/runbook/index.md` around lines 188 - 195, The
cause/action bullets in the runbook use awkward “then” phrasing; revise the
bullet text in the affected list under the MSSQL Server DR runbook so the cause
is followed by a colon or a cleaner rephrasing. Update the bullets starting with
the “Lease did not move” and “No quorum in the survivor” entries, and apply the
same style fix to the “Fence not clearing” entry in the same list to keep the
wording consistent and clear.

314-316: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add output example or remove dollar signs.

Commands use dollar signs without output.

- $ kubectl get petset -n demo -l app.kubernetes.io/instance=mssql-dcdr
+ kubectl get petset -n demo -l app.kubernetes.io/instance=mssql-dcdr

(Apply to both lines 314 and 315)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/runbook/index.md` around lines 314 - 316, The
command examples in the runbook use shell prompts inconsistently, so update the
two kubectl examples in the mssqlserver DR runbook to either include matching
output examples or remove the leading dollar signs. Keep the formatting
consistent within the same example block so the commands shown alongside kubectl
get petset and kubectl get mssqlserveropsrequest are presented the same way.

163-165: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add output example or remove dollar signs.

Commands use dollar signs without output.

- $ kubectl --kubeconfig <coord> -n dc-failover get lease primary-dc        # error / stale renewTime
+ kubectl --kubeconfig <coord> -n dc-failover get lease primary-dc        # error / stale renewTime

(Apply to line 163 and line 164)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/runbook/index.md` around lines 163 - 165, The
runbook examples in the disaster recovery section use shell prompt markers
without showing any corresponding output, so either add an actual output example
after the commands or remove the prompt-style markers to keep the examples
consistent. Update the relevant command examples in the markdown so they read
clearly as executable snippets, using the nearby kubectl commands as the anchors
for the change.

261-266: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Clarify "then" usage in cause/action bullets.

Same grammatical issue with "then" in bullets.

- - **Marker stale** (`renewTime` old) then the agent cannot reach the coordination plane, or
+ - **Marker stale** (`renewTime` old): the agent cannot reach the coordination plane, or

(Apply similar fixes to lines 264, 265)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/runbook/index.md` around lines 261 - 266, The
cause/action bullets in the runbook use awkward “then” phrasing; rewrite the
entries under the affected section so each bullet reads cleanly without that
construction while preserving the same meaning. Update the related bullet text
in the markdown list near the “Marker stale”, “Marker names another DC”, and
“Clock skew” items so the cause and remedy are expressed in direct, grammatical
language.

63-65: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add output example or remove dollar signs.

The verify commands use dollar signs without showing output.

- $ kubectl get mssqlserver -n demo mssql-dcdr -o jsonpath='{.status.disasterRecovery.activeDC}'   # the survivor
+ kubectl get mssqlserver -n demo mssql-dcdr -o jsonpath='{.status.disasterRecovery.activeDC}'   # the survivor

(Apply to both lines 63-64)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/runbook/index.md` around lines 63 - 65, The verify
commands in the runbook are shown without any example output or shell prompt
context, so update the documentation around the jsonpath checks for activeDC and
phase to either include the expected output values or remove the dollar-sign
prompt styling entirely. Keep the guidance aligned with the existing mssqlserver
disasterRecovery verification examples so readers can clearly see what the
commands return.

181-184: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add output example or remove dollar signs.

Commands use dollar signs without output.

- $ kubectl --kubeconfig <coord> -n dc-failover get lease primary-dc -o jsonpath='{.spec.holderIdentity}'
+ kubectl --kubeconfig <coord> -n dc-failover get lease primary-dc -o jsonpath='{.spec.holderIdentity}'

(Apply to both lines 181 and 183-184)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/runbook/index.md` around lines 181 - 184, The
command examples in the runbook use shell prompt markers without showing any
actual output, so either add sample output for the commands in the MSSQL DR
runbook or remove the prompt markers from the examples. Update the affected
snippets around the lease lookup and the pod listing so they are consistent with
the rest of the document, using the relevant command examples in the runbook
index.

254-254: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add output example or remove dollar sign.

Command uses dollar sign without output.

- $ kubectl -n dc-failover get configmap primary-dc -o jsonpath='{.data}'
+ kubectl -n dc-failover get configmap primary-dc -o jsonpath='{.data}'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/runbook/index.md` at line 254, The command example
is missing an output example while using the shell prompt marker, so either add
a sample of the command output or remove the prompt symbol from the kubectl
example. Update the relevant markdown snippet in the runbook so the command is
shown consistently, and verify nearby examples in the same section follow the
same formatting.

25-37: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove dollar signs from quick reference commands.

All commands in the quick reference block use dollar signs without showing output, which breaks copy-paste and triggers markdown lint warnings.

- $ kubectl get mssqlserver ...
+ kubectl get mssqlserver ...

(Apply to all four commands in the block: lines 27, 30, 33, 36)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/runbook/index.md` around lines 25 - 37, The quick
reference commands in the runbook still include shell prompt markers, which
breaks copy-paste and markdown linting. Update the command block under the
disaster recovery section so the kubectl/jq examples in the quick reference are
shown as plain commands without leading prompt symbols; keep the same commands
and context, and make sure the references near the lease, pods, and configmap
examples remain easy to copy.

341-343: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add output example or remove dollar signs.

Commands use dollar signs without output.

- $ kubectl get pods -n demo -l app.kubernetes.io/instance=mssql-dcdr -L kubedb.com/role,open-cluster-management.io/cluster-name
+ kubectl get pods -n demo -l app.kubernetes.io/instance=mssql-dcdr -L kubedb.com/role,open-cluster-management.io/cluster-name

(Apply to both lines 341 and 342)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/runbook/index.md` around lines 341 - 343, The
command examples in the runbook section show shell prompts without any
corresponding output, so either add the expected output for the kubectl commands
or remove the leading dollar signs from the examples. Update both command lines
in the MSSQL DR runbook snippet so the formatting is consistent and the examples
read correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/guides/mssqlserver/dr/overview/index.md`:
- Around line 93-96: The overview text in the DC-DR documentation has a grammar
issue around the sentence describing layouts with three or more data DCs; update
the wording in the relevant prose block near the Distributed AG explanation so
it reads naturally, using the existing terms like Distributed AG, chained DAGs,
and arbiter DC, and adjust the phrase from “needs chained” to “needs to be
chained” (or equivalent corrected wording) without changing the technical
meaning.
- Around line 234-270: The MSSQLServer example includes an invalid top-level
distributed flag alongside spec.topology.mode, so remove spec.distributed from
the sample and keep DistributedAG selection only under
MSSQLServer.spec.topology.mode. Update the example in the DC-DR overview doc so
the manifest matches the CRD shape and uses only the existing topology and
availabilityGroup fields.

---

Nitpick comments:
In `@docs/guides/mssqlserver/dr/guide/index.md`:
- Around line 43-48: The fenced example in the guide is missing a language
specifier, so update the ConfigMap snippet to use a YAML code fence. Locate the
documentation block around the primary-dc ConfigMap example and change the
opening fence to include the proper language tag while keeping the example
content unchanged.
- Line 24: The markdown link text in the introductory callout is too generic and
should be made descriptive. Update the link in the opening “New to KubeDB?”
sentence to use meaningful anchor text, such as “the KubeDB getting started
guide,” so the target is clear without relying on “here.”
- Around line 195-196: The markdown example in the disaster recovery guide has a
shell prompt without the corresponding command output, which breaks copy-paste
formatting. Update the example around the kubectl/jsonpath snippet to either
remove the leading dollar sign from the command or include the expected output
block, keeping the fenced code section consistent with the other examples in the
guide.
- Around line 327-329: The parenthetical in the DR guide is confusing because it
describes DAG automatic seeding as an “analog” rather than the actual SQL Server
mechanism. Update the wording in the affected paragraph to refer directly to
automatic seeding and remove the “analog of a re-seed, not a transparent rejoin”
phrasing. Keep the explanation aligned with the surrounding discussion of the AG
removal, automatic seeding, and catch-up flow.
- Around line 300-301: The command example in the MSSQLServer DR guide is
showing a shell prompt without any accompanying output, so update the example to
either remove the leading dollar sign or include the command output. Locate the
kubectl annotate example in the DR guide content and make the snippet consistent
with the surrounding documentation style.
- Around line 68-72: The fenced flags block in the MSSQL Server DR guide is
missing a language specifier; update the markdown snippet to use a bash-labeled
code fence for the operator flags example. Locate the fenced block containing
the --dc-dr-enabled, --dc-dr-coord-kubeconfig, and --dc-dr-local-dc flags in the
guide content and add the appropriate language tag while keeping the existing
flag lines unchanged.
- Around line 391-392: The example command in the MSSQL Server DR guide is
showing a shell prompt marker without any accompanying output, which makes the
snippet look incomplete. Update the relevant command block to either remove the
leading dollar sign or add the expected command output after the command, and
keep the example consistent with the surrounding markdown code samples.
- Around line 321-322: The example command in the MSSQLServer DR guide is shown
with a dollar-sign prompt but no accompanying output, so update the snippet to
either remove the prompt prefix or add the expected output/continuation for the
kubectl annotate example. Adjust the markdown example near the switchover
command so it matches the surrounding documentation style and does not present a
standalone shell prompt.
- Around line 244-246: The phrase “last un-shipped redo” in the failover
description is imprecise and should be replaced with terminology that matches
SQL Server replication semantics. Update the wording in the DR guide text to
refer to un-shipped or un-replicated transaction log/log records instead of
redo, keeping the rest of the explanation intact and consistent with the
surrounding `SYNCHRONOUS_COMMIT` and `last_hardened_lsn` discussion.

In `@docs/guides/mssqlserver/dr/overview/index.md`:
- Line 39: The link text in this markdown callout is non-descriptive, so update
it to clearly describe the destination instead of using “here.” Edit the
existing link in the overview content to use a meaningful label that points to
the same /docs/README.md target, keeping the surrounding “New to KubeDB?”
sentence intact.
- Around line 174-178: The fenced operator flags block is missing a language
identifier, which triggers Markdown linting issues. Update the code fence in the
overview guide to specify a language such as text or bash so the block renders
correctly; this is the block containing the --dc-dr-enabled,
--dc-dr-coord-kubeconfig, and --dc-dr-local-dc flags.

In `@docs/guides/mssqlserver/dr/runbook/index.md`:
- Around line 19-22: The link text in the runbook intro should be more specific
than “User Guide”; update the reference in the markdown near the opening
guidance to use descriptive text that identifies it as the DC-DR User Guide for
concepts and commands, while keeping the existing target unchanged.
- Around line 144-145: The runbook command example includes shell prompt dollar
signs without showing any corresponding output, so either remove the dollar
signs from the command snippet or add an example output block after the command.
Update the affected documentation around the kubectl get mssqlserver example so
the formatting is consistent and the command is clearly presented.
- Around line 100-101: The runbook command example in the MSSQL Server DR guide
uses shell prompt dollar signs without showing terminal output, so either remove
the dollar signs or add a matching output example for the command. Update the
example around the kubectl annotate command so it is consistent with the
surrounding documentation style.
- Around line 86-87: The runbook command example includes a shell prompt
indicator without showing any output, which makes the snippet inconsistent;
update the example in the relevant documentation section to either remove the
dollar sign or add a matching output example. Use the kubectl jsonpath command
shown in the disaster recovery guide to locate the snippet and keep the
formatting consistent with the surrounding examples.
- Around line 112-114: The example commands in the runbook use shell prompt
markers without showing any corresponding output, so either remove the dollar
signs or add explicit output examples for both kubectl get mssqlserver jsonpath
commands in the disasterRecovery section. Update the nearby documentation
snippet that references activeDC and phase so the formatting is consistent with
the rest of the guide.
- Around line 206-209: The kubectl example in the disaster recovery runbook uses
shell-style command formatting without showing any output, so either add a
representative output example for the jsonpath command or remove any dollar-sign
prompt styling if present elsewhere in the section. Update the documentation
around the kubectl get mssqlserver command to make the example self-explanatory
and consistent with the surrounding runbook examples.
- Around line 213-220: Rephrase the cause/action bullets in the runbook section
to remove the awkward “then” construction by using a colon or equivalent clearer
phrasing; update the affected bullet text in the switchover guidance so the
condition and the follow-up action read naturally and consistently, especially
in the entries describing LSN equality, target health/no lag, and target being
too far behind.
- Around line 125-126: The command example includes a shell prompt marker
without showing the resulting output, so either add a matching output example
for the kubectl annotate command or remove the dollar-sign prompt styling from
the runbook snippet. Update the affected example in the DR runbook so the
formatting is consistent with the rest of the markdown and clearly reflects the
intended usage of kubectl annotate.
- Around line 359-363: The runbook command examples include shell prompts
without showing any corresponding output, so either remove the leading dollar
signs or add matching output examples for the commands in this block. Update the
markdown in the runbook section that includes kubectl get mssqlserver, kubectl
--kubeconfig, kubectl get configmap, kubectl get pods, and kubectl logs so the
examples are consistent and copyable.
- Around line 286-287: The runbook command example includes a shell prompt-style
dollar sign but does not show any corresponding output, so update the nearby
documentation in the disaster recovery section to either remove the dollar sign
from the command or add a matching output example. Keep the fix focused on the
kubectl get mssqlserver jsonpath example so the formatting is consistent with
the rest of the guide.
- Line 222: The kubectl annotate command example in the runbook is missing a
proper shell prompt or output context, so either add an output example for the
command or remove the leading dollar-sign style from the snippet. Update the
example around the kubectl annotate mssqlserver invocation so it is consistent
with the surrounding docs formatting and clearly indicates whether it is a
command or output.
- Around line 188-195: The cause/action bullets in the runbook use awkward
“then” phrasing; revise the bullet text in the affected list under the MSSQL
Server DR runbook so the cause is followed by a colon or a cleaner rephrasing.
Update the bullets starting with the “Lease did not move” and “No quorum in the
survivor” entries, and apply the same style fix to the “Fence not clearing”
entry in the same list to keep the wording consistent and clear.
- Around line 314-316: The command examples in the runbook use shell prompts
inconsistently, so update the two kubectl examples in the mssqlserver DR runbook
to either include matching output examples or remove the leading dollar signs.
Keep the formatting consistent within the same example block so the commands
shown alongside kubectl get petset and kubectl get mssqlserveropsrequest are
presented the same way.
- Around line 163-165: The runbook examples in the disaster recovery section use
shell prompt markers without showing any corresponding output, so either add an
actual output example after the commands or remove the prompt-style markers to
keep the examples consistent. Update the relevant command examples in the
markdown so they read clearly as executable snippets, using the nearby kubectl
commands as the anchors for the change.
- Around line 261-266: The cause/action bullets in the runbook use awkward
“then” phrasing; rewrite the entries under the affected section so each bullet
reads cleanly without that construction while preserving the same meaning.
Update the related bullet text in the markdown list near the “Marker stale”,
“Marker names another DC”, and “Clock skew” items so the cause and remedy are
expressed in direct, grammatical language.
- Around line 63-65: The verify commands in the runbook are shown without any
example output or shell prompt context, so update the documentation around the
jsonpath checks for activeDC and phase to either include the expected output
values or remove the dollar-sign prompt styling entirely. Keep the guidance
aligned with the existing mssqlserver disasterRecovery verification examples so
readers can clearly see what the commands return.
- Around line 181-184: The command examples in the runbook use shell prompt
markers without showing any actual output, so either add sample output for the
commands in the MSSQL DR runbook or remove the prompt markers from the examples.
Update the affected snippets around the lease lookup and the pod listing so they
are consistent with the rest of the document, using the relevant command
examples in the runbook index.
- Line 254: The command example is missing an output example while using the
shell prompt marker, so either add a sample of the command output or remove the
prompt symbol from the kubectl example. Update the relevant markdown snippet in
the runbook so the command is shown consistently, and verify nearby examples in
the same section follow the same formatting.
- Around line 25-37: The quick reference commands in the runbook still include
shell prompt markers, which breaks copy-paste and markdown linting. Update the
command block under the disaster recovery section so the kubectl/jq examples in
the quick reference are shown as plain commands without leading prompt symbols;
keep the same commands and context, and make sure the references near the lease,
pods, and configmap examples remain easy to copy.
- Around line 341-343: The command examples in the runbook section show shell
prompts without any corresponding output, so either add the expected output for
the kubectl commands or remove the leading dollar signs from the examples.
Update both command lines in the MSSQL DR runbook snippet so the formatting is
consistent and the examples read correctly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6b2f3a31-888a-4abd-a955-49ac15bfdd9c

📥 Commits

Reviewing files that changed from the base of the PR and between 405b88b and cc55655.

📒 Files selected for processing (5)
  • docs/guides/mssqlserver/README.md
  • docs/guides/mssqlserver/dr/_index.md
  • docs/guides/mssqlserver/dr/guide/index.md
  • docs/guides/mssqlserver/dr/overview/index.md
  • docs/guides/mssqlserver/dr/runbook/index.md

Comment on lines +93 to +96
> A native Distributed AG joins **exactly two** AGs, so DC-DR for SQL Server targets the
> even layout: two data DCs plus a data-less Arbiter DC. Spanning three or more data DCs
> needs chained DAGs and is a separate, larger design that is out of scope here. The arbiter
> DC holds only the `dr-controlplane` etcd member and no SQL Server.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix grammar: "needs chained" → "needs to be chained".

- > needs chained DAGs and is a separate, larger design that is out of scope here.
+ > needs to be chained DAGs and is a separate, larger design that is out of scope here.

Actually better:

- > needs chained DAGs and is a separate, larger design that is out of scope here.
+ > requires chained DAGs and is a separate, larger design that is out of scope here.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
> A native Distributed AG joins **exactly two** AGs, so DC-DR for SQL Server targets the
> even layout: two data DCs plus a data-less Arbiter DC. Spanning three or more data DCs
> needs chained DAGs and is a separate, larger design that is out of scope here. The arbiter
> DC holds only the `dr-controlplane` etcd member and no SQL Server.
> A native Distributed AG joins **exactly two** AGs, so DC-DR for SQL Server targets the
> even layout: two data DCs plus a data-less Arbiter DC. Spanning three or more data DCs
> requires chained DAGs and is a separate, larger design that is out of scope here. The arbiter
> DC holds only the `dr-controlplane` etcd member and no SQL Server.
🧰 Tools
🪛 LanguageTool

[style] ~95-~95: The double modal “needs chained” is nonstandard (only accepted in certain dialects). Consider “to be chained”.
Context: ...Spanning three or more data DCs > needs chained DAGs and is a separate, larger design t...

(NEEDS_FIXED)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/overview/index.md` around lines 93 - 96, The
overview text in the DC-DR documentation has a grammar issue around the sentence
describing layouts with three or more data DCs; update the wording in the
relevant prose block near the Distributed AG explanation so it reads naturally,
using the existing terms like Distributed AG, chained DAGs, and arbiter DC, and
adjust the phrase from “needs chained” to “needs to be chained” (or equivalent
corrected wording) without changing the technical meaning.

Comment on lines +234 to +270
```yaml
apiVersion: kubedb.com/v1alpha2
kind: MSSQLServer
metadata:
name: mssql-dcdr
namespace: demo
annotations:
# Opt this distributed MSSQLServer into per-DC DC-DR expansion.
dr.kubedb.com/enabled: "true"
spec:
version: "2022-cu16"
replicas: 6
distributed: true
topology:
mode: DistributedAG
availabilityGroup:
databases:
- agdb
storageType: Durable
podTemplate:
spec:
podPlacementPolicy:
name: mssql-dcdr
containers:
- name: mssql
env:
- name: ACCEPT_EULA
value: "Y"
- name: MSSQL_PID
value: Evaluation
storage:
accessModes: [ReadWriteOnce]
resources:
requests:
storage: 1Gi
deletionPolicy: WipeOut
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the distributed field exists in MSSQLServer CRD
rg -n "distributed" --type yaml --type json -g '*mssqlserver*' -g '*crd*' | head -20

Repository: kubedb/docs

Length of output: 149


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find MSSQLServer CRD/schema definitions and any examples using the field
git ls-files | rg 'mssqlserver|mssql.*crd|crd.*mssql|mssqlserver.*yaml|mssqlserver.*json|mssqlserver.*md' || true

printf '\n--- distributed matches ---\n'
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' \
  '\bdistributed\b' .

printf '\n--- MSSQLServer schema hints ---\n'
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' \
  'kind:\s*MSSQLServer|MSSQLServer' .

printf '\n--- spec fields around topology/distributed in docs/examples ---\n'
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' \
  'topology:|distributed:|distribution:|DistributedAG|Replica|replicas:' docs .

Repository: kubedb/docs

Length of output: 50369


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- MSSQLServer concept doc around topology ---'
sed -n '250,380p' docs/guides/mssqlserver/concepts/mssqlserver.md

echo
echo '--- exact distributed field search in MSSQLServer docs ---'
rg -n --hidden --glob 'docs/guides/mssqlserver/**' '\bspec\.distributed\b|^\s*distributed:\s*true\b|^\s*distribution:\s*' docs/guides/mssqlserver || true

echo
echo '--- topology.mode search in MSSQLServer docs ---'
rg -n --hidden --glob 'docs/guides/mssqlserver/**' 'topology:\s*$|mode:\s*DistributedAG\b' docs/guides/mssqlserver || true

Repository: kubedb/docs

Length of output: 10502


Remove distributed: true from the MSSQLServer example
DistributedAG is selected through spec.topology.mode; spec.distributed is not part of this CRD shape and should be dropped from the sample.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/mssqlserver/dr/overview/index.md` around lines 234 - 270, The
MSSQLServer example includes an invalid top-level distributed flag alongside
spec.topology.mode, so remove spec.distributed from the sample and keep
DistributedAG selection only under MSSQLServer.spec.topology.mode. Update the
example in the DC-DR overview doc so the manifest matches the CRD shape and uses
only the existing topology and availabilityGroup fields.

Ensure the file ends with a single newline (markdownlint MD047) after
appending the Cross-DC Disaster Recovery section.

Signed-off-by: Tamal Saha <tamal@appscode.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant