Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cggaurav/89658acf1539197cd7d6c0122196f205 to your computer and use it in GitHub Desktop.
Save cggaurav/89658acf1539197cd7d6c0122196f205 to your computer and use it in GitHub Desktop.
it is very unusual that you needed to do an unsafe_rollback, unless some replicas were down.
In general, you can switch over the primary manually without a full reconfigure by doing the following. This can reduce the time of table unavailability compared to a full `reconfigure`:
1. Run `r.table(...).config()`
2. Copy out the value of the "shards" field. Here's a simple example:
[{"nonvoting_replicas": [], "primary_replica": "newton_s4j", "replicas": ["newton_s4j"]}]
3. Replace the values of the "primary_replica" fields where necessary by the new server name. If your goal is to shut down the old primary in the end, you should also remove it from all "replicas" lists. For easy editing, you can just copy the value into a text editor.
4. Run `r.table(...).config().update({shards: newShardsValue})` to apply the new configuration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment