Commit graph

7 commits

Author SHA1 Message Date
jedarden
f7043d4518 docs: add troubleshooting cross-links to production and examples guides
Add cross-links from the production deployment guide and Docker Compose
examples README to the main troubleshooting guide and diagnostic playbook.
This completes the cross-linking requirement for P11.5.

Changes:
- docs/onboarding/production.md: Add cross-link to troubleshooting guide
- examples/README.md: Add cross-link to troubleshooting guide

Closes: miroir-uyx.5

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 02:55:06 -04:00
jedarden
304879d32a feat(tests): add chaos test scenarios and runbooks (plan §8, P9.4)
Add comprehensive chaos testing infrastructure for Miroir failure scenarios:

- **TestCluster** harness with chaos helpers:
  - `kill_meili()` / `restart_meili()` for node failure simulation
  - `apply_netem()` / `remove_netem()` for network delay injection
  - `kill_miroir()` / `restart_miroir()` for orchestrator failure
  - Docker-compose stack lifecycle management

- **6 chaos test scenarios** (all marked `#[ignore]`):
  1. Kill 1 of 3 nodes (RF=2) → continuous search, no degraded header
  2. Kill 2 of 3 nodes (RF=2) → 503 or partial results with degraded header
  3. Kill 1 of 2 Miroir replicas → zero client-visible downtime
  4. tc netem 500ms delay → searches slow but succeed, no errors
  5. Restart killed node → Miroir detects recovery within health check interval
  6. Kill node mid-rebalance → rebalancer pauses, resumes on recovery

- **Runbooks** in `tests/chaos/runbooks/scenario*.md`:
  - Manual reproduction steps
  - Expected observables (metrics, headers, errors)
  - Recovery procedures
  - HA vs single-instance differences
  - Operator notes and common causes

- **Updated docker-compose files**:
  - Added `CAP_NET_ADMIN` to all Meilisearch containers for tc netem support

Tests are slow (30+ seconds each) and require docker-compose. Run with:
  cargo test --test chaos -- --ignored --test-threads=1

Closes: miroir-89x.4
2026-05-24 10:23:24 -04:00
jedarden
599c107ad6 feat(tests): add cross-compatibility SDK tests and standalone Meilisearch
Additions:
- Standalone Meilisearch instance on port 7704 in docker-compose-dev.yml
  for API compatibility testing against plain Meilisearch
- Cross-compatibility test script (run_cross_compat_tests.sh) that runs
  each SDK smoke test against both Miroir and plain Meilisearch
- Documentation of intentional API differences (X-Miroir-* headers,
  Miroir-specific error codes, admin endpoints)

Fixes:
- Clone state.query_planner and state.metrics before moving into async
  closure in multi_search.rs to fix compilation error
- Add catch-all pattern in error_response.rs MiroirError match to
  handle non-exhaustive enum variants

Closes: miroir-89x.3
2026-05-24 08:40:58 -04:00
jedarden
158752fe7b feat(multi-search): implement timeout enforcement and acceptance tests (§13.11)
- Add per-query and total timeout enforcement to MultiSearchExecutor
- Improve SearchResult with helper methods (ok, err, timeout, is_success)
- Fix ModeACoordinator feature-gate compilation issues
- Add comprehensive acceptance tests for multi-search:
  - 5-query batch completion
  - Slow query doesn't block fast queries (parallel execution)
  - Partial failure handling
  - Per-query timeout
  - Total timeout
  - 100-query batch completion

Closes: miroir-uhj.11
2026-05-24 01:54:20 -04:00
jedarden
7bbf8f1061 P9.2: Integration test harness with docker-compose
Add comprehensive integration test infrastructure:
- docker-compose-dev.yml: 3 Meilisearch nodes + Miroir (RG=1, RF=1, S=16)
- docker-compose-dev-rf2.yml: 6 Meilisearch nodes + Redis + Miroir (RG=2, RF=2)
- dev-config.yaml/dev-config-rf2.yaml: Configurations for both stacks
- Integration tests in crates/miroir-proxy/tests/docker_compose_integration.rs
- Documentation in crates/miroir-proxy/tests/README_integration.md
- CI workflow in k8s/argo-workflows/miroir-ci-docker-compose-smoke.yaml

Test coverage (plan §8):
- Document round-trip (1000 docs)
- Search coverage across all 16 shards
- Facet aggregation
- Offset/limit pagination
- Settings broadcast
- Task polling
- Health checks
- Node failure with RF=2

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 07:33:34 -04:00
jedarden
32bda26613 P9.2: Integration test harness with docker-compose
Implement integration test suite for Miroir with docker-compose:

- Updated docker-compose-dev.yml to use Meilisearch v1.37.0
- Created tests/integration.rs with comprehensive test coverage:
  * Document round-trip (1000 docs)
  * Search coverage across all shards (unique-keyword test)
  * Facet aggregation (3 colors, sum = 100)
  * Offset/limit paging
  * Settings broadcast
  * Task polling
  * Health check
  * Node failure test with RF=2
- Created docker-compose-dev-rf2.yml for RF=2/HA testing (6 nodes)
- Created dev-config-rf2.yaml for RF=2 configuration
- Created tests/README.md with documentation

Tests run against real Docker Compose stack:
  cargo test --test integration -- --test-threads=1

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 07:26:55 -04:00
jedarden
9ba6d545ca P11.7: Add quick-start example artifacts (Docker Compose + config)
Adds the on-disk examples referenced by plan §11 "Quick start (local, Docker Compose)":

- examples/docker-compose-dev.yml: 3 Meilisearch nodes + 1 Miroir orchestrator
- examples/dev-config.yaml: Matching Miroir config (16 shards, RF=1)
- examples/README.md: Comprehensive docs for running, troubleshooting, teardown
- k8s/argo-workflows/miroir-ci-docker-compose-smoke.yaml: CI smoke tests

The README.md quick start section already references these examples.

Acceptance:
 docker-compose-dev.yml boots via docker compose up
 dev-config.yaml mounted into Miroir container
 examples/README.md documents usage and teardown
 CI smoke job exercises compose stack (health + index + search tests)
 README.md quick start points to examples/docker-compose-dev.yml

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 06:49:05 -04:00