Skip to content

Add cross-region write forwarding for the active-passive topology #691

Description

@thlpkee20-wq

Description

When receiving writes in the passive region, either forward via an authenticated tunnel to the active region or return a 302 with the active URL. Reduces failover data loss window.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review
  • Relevant code: cmd/server/main.go, internal/routes/routes.go
  • Prevent write loops with a hop header

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feat/cross-region-write-forward
  • Implement changes
    • Add internal/middleware/region_router.go
    • Config REGION_ROLE=passive|active
    • Trace attribute for forwarded requests
  • Validate security and correctness assumptions

Test and commit

  • Run tests
    • go test ./internal/middleware/...
  • Cover edge cases
    • Active region unreachable: return 503 with helpful body
  • Include test output and notes

Example commit message

feat: forward writes from passive region to active

Guidelines

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Labels

Stellar WaveStellar Wave issue batch

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions