Skip to content

[xmin-sync] Task 3: Sync Command Integration (Hour 5-6) #60

@taariq

Description

@taariq

Overview

Integrate all xmin modules into the sync command with automatic mode detection.

Reference

  • Proposal: docs/20251208_Replication_Sync_Proposal.md

Scope

Sync Command (src/commands/sync.rs)

Add automatic wal_level detection and xmin fallback:

  1. Check source wal_level
  2. If 'logical' -> use existing logical replication code path
  3. If 'replica' (default) -> use new xmin sync path
  4. Clear INFO logging about which method is selected

Key Requirements

  • Zero customer-facing flags (automatic detection)
  • Clear logging of which sync method is selected
  • Proper error handling and user feedback

Files to Modify

  • src/commands/sync.rs
  • src/lib.rs (add xmin module export)
  • src/main.rs (if needed for daemon module)

Acceptance Criteria

  • Auto-detects wal_level on source
  • Falls back to xmin sync when wal_level != logical
  • Clear INFO logging about sync method selection
  • No new CLI flags required
  • Integrates with existing sync command structure
  • Unit tests for auto-detection logic

Important

⚠️ DO NOT fix failing tests in files outside your scope. If you encounter test failures in:

  • src/xmin/reader.rs (Gemini scope)
  • src/xmin/state.rs (Gemini scope)
  • src/xmin/reconciler.rs (Gemini scope)
  • src/daemon/* (Gemini scope)

Create a comment noting the failure but do not attempt to fix it.

Dependencies

  • All previous tasks (uses all xmin modules and daemon)

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions