Skip to content

Conversation

@joshrotenberg
Copy link
Collaborator

Summary

Removes three database action methods from crate that call non-existent API endpoints.

Problem

The library contained three methods that always fail with 404:

  • BdbHandler::start() - calls /v1/bdbs/{uid}/actions/start
  • BdbHandler::stop() - calls /v1/bdbs/{uid}/actions/stop
  • BdbHandler::restart() - calls /v1/bdbs/{uid}/actions/restart

Verification

Docker Cluster Testing:

# All return 404 Not Found
curl -k -u "admin@redis.local:Redis123!" -X POST https://localhost:9443/v1/bdbs/1/actions/restart
curl -k -u "admin@redis.local:Redis123!" -X POST https://localhost:9443/v1/bdbs/1/actions/start
curl -k -u "admin@redis.local:Redis123!" -X POST https://localhost:9443/v1/bdbs/1/actions/stop

Documentation Search:
Comprehensive search of redis.io REST API documentation confirms these endpoints do not exist. The complete list of documented database action endpoints is:

  • stop_traffic / resume_traffic (NOT the same as stop/start)
  • export / import / recover
  • optimize_shards_placement / rebalance
  • backup_reset_status / import_reset_status / export_reset_status

Search results: https://redis.io/docs/latest/operate/rs/references/rest-api/requests/bdbs/actions/

Changes

Removed Methods:

  • crates/redis-enterprise/src/bdb.rs - Removed start(), stop(), restart() methods

Removed Tests:

  • crates/redis-enterprise/tests/database_tests.rs - Removed test_database_start, test_database_stop
  • crates/redis-enterprise/src/lib_tests.rs - Removed test_database_action_start, test_database_action_stop

Documentation Updates:

  • docs/src/enterprise/examples.md - Changed "Rolling Restart" example to use stop_traffic/resume_traffic
  • docs/src/enterprise/api-access.md - Updated action list to show actual endpoints

Testing

cargo test --package redis-enterprise  # ✅ All 335 tests pass
cargo clippy --all-targets --all-features -- -D warnings  # ✅ No warnings
cargo fmt --all -- --check  # ✅ Clean

Related Issues

Closes #421 - Database restart command cannot be implemented as the API doesn't support it

Notes

While rladmin restart db exists as a CLI command, it uses internal mechanisms not exposed via the REST API. Users needing to pause traffic should use stop_traffic + resume_traffic instead, though this doesn't achieve the same effect as restarting the database process.

Remove three database action methods that call non-existent API endpoints:
- BdbHandler::start() - /v1/bdbs/{uid}/actions/start (404)
- BdbHandler::stop() - /v1/bdbs/{uid}/actions/stop (404)
- BdbHandler::restart() - /v1/bdbs/{uid}/actions/restart (404)

Testing against Docker cluster and comprehensive documentation search of
redis.io REST API docs confirms these endpoints do not exist. The complete
list of documented database action endpoints is:

- stop_traffic / resume_traffic (NOT the same as stop/start)
- export / import / recover
- optimize_shards_placement / rebalance
- backup_reset_status / import_reset_status / export_reset_status

Also removed associated tests and updated documentation to use correct
endpoints (stop_traffic/resume_traffic instead of restart).

Closes #421
@joshrotenberg joshrotenberg merged commit f48c252 into main Nov 1, 2025
23 checks passed
@joshrotenberg joshrotenberg deleted the fix/remove-nonexistent-bdb-methods branch November 1, 2025 02:54
@joshrotenberg joshrotenberg mentioned this pull request Nov 1, 2025
@joshrotenberg joshrotenberg mentioned this pull request Nov 25, 2025
This was referenced Dec 9, 2025
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.

feat: Add database restart command

2 participants