Site Tools


Hotfix release available: 2025-05-14b "Librarian". upgrade now! [56.2] (what's this?)
Hotfix release available: 2025-05-14a "Librarian". upgrade now! [56.1] (what's this?)
New release available: 2025-05-14 "Librarian". upgrade now! [56] (what's this?)
Hotfix release available: 2024-02-06b "Kaos". upgrade now! [55.2] (what's this?)
Hotfix release available: 2024-02-06a "Kaos". upgrade now! [55.1] (what's this?)
New release available: 2024-02-06 "Kaos". upgrade now! [55] (what's this?)
Hotfix release available: 2023-04-04b "Jack Jackrum". upgrade now! [54.2] (what's this?)
Hotfix release available: 2023-04-04a "Jack Jackrum". upgrade now! [54.1] (what's this?)
New release available: 2023-04-04 "Jack Jackrum". upgrade now! [54] (what's this?)
Hotfix release available: 2022-07-31b "Igor". upgrade now! [53.1] (what's this?)
Hotfix release available: 2022-07-31a "Igor". upgrade now! [53] (what's this?)
New release available: 2022-07-31 "Igor". upgrade now! [52.2] (what's this?)
New release candidate 2 available: rc2022-06-26 "Igor". upgrade now! [52.1] (what's this?)
New release candidate available: 2022-06-26 "Igor". upgrade now! [52] (what's this?)
Hotfix release available: 2020-07-29a "Hogfather". upgrade now! [51.4] (what's this?)
New release available: 2020-07-29 "Hogfather". upgrade now! [51.3] (what's this?)
New release candidate 3 available: 2020-06-09 "Hogfather". upgrade now! [51.2] (what's this?)
New release candidate 2 available: 2020-06-01 "Hogfather". upgrade now! [51.1] (what's this?)
New release candidate available: 2020-06-01 "Hogfather". upgrade now! [51] (what's this?)
Hotfix release available: 2018-04-22c "Greebo". upgrade now! [50.3] (what's this?)
Hotfix release available: 2018-04-22b "Greebo". upgrade now! [50.2] (what's this?)
database_rollback

Database Rollback

Background

When a Master database fails or inappropriate data is populated into the Master during production deployments, a replicated slave can be “promoted” as Master to take over it.

Steps to do

  • Take full database backup
  • Stop Slave replicating from the Master
  • Ensure Slave is detached from the Master by verifying the respective (Binary & Relay) logs.
  • Deploy the release & backfill tasks. Changes should get updated only in Master.
  • After successful deployment, data updates and full deployment testing/verification, reconnect the existing Slave to Master.
  • In case of unsuccessful deployment, as a process of rollback, detach the Master
  • Promote the original Slave as a new Master.
  • Connect the old Master as a new Slave to the new Master. So that the new Slave starts replicating from the Master. When both new Master and new Slave are in Sync, revert the Master and Slave (i.e. the new Slave is now the Master and the new Master is now the Slave, thus effectively setting the Master and Salve back to their original roles, at the start of deployment
  • No change in application end.

Application Database Configuration

production:
  adapter: mysql
  encoding: utf8
  database: cbprod
  username: cbpuser
  port: 3306
  password: ***
  host: 10.166.152.12
  pool: 23

production_slave_database:
  adapter: mysql
  encoding: utf8
  database: cbprod
  username: cbpuser
  port: 3306
  password: ***
  host: 10.166.152.13
  pool: 23
 
database_rollback.txt · Last modified: 2018/08/31 16:16 (external edit)