Jump to: navigation, search

Trove/Specs/Trove-v1-MySQL-Replication

< Trove
Revision as of 20:36, 21 April 2014 by Vgnbkr (talk | contribs)

Description

Providing support for the various replication use cases is critical for use of Trove in production. For the first phase implementation of Replication in Trove we will implement the functionality laid out in the Trove V1 Replication Blueprint

Use Case Summary

The following use cases will be addressed by this V1 implementation:

A. Read Replicas (Slaves)

  1. The master can exist before the slave such that the master already contains data
  2. N Slaves for one master
  3. Slaves can be marked read-only (read-only will be default)
  4. A slave can be detached from "replication set" to act as independent site
  5. A pre-existing non-replication site can become the master of a new "replication set"
  6. The health of a slave will be monitor-able

Design

Trove API

Python-Troveclient

Taskmanager

The taskmanager will implement 2 API calls:

  • createReplication(master=<instance>, slave_count=<N>)
  • detachReplication(slave=<instance>)

taskmanage.createReplication

The Create Replication task will be performed with the following steps:

  1. Execute getReplicationSnapshot() on the master site, receiving "master snapshot results metadata"
  2. N times:
    1. Create trove instance
    2. execute createReplicationSlave() on new instance
  3. delete replication snapshot from Swift

Trove GuestAgent

There will be 3 new methods added to the guestagent API:

  • getReplicationSnapshot()
  • createReplicationSlave()
  • detachReplicationSlave()

Replication will be focused around a replication snapshot. This snapshot will contain the data necessary to set up a slave to replicate from the site which created the snapshot, typically a URI to the user's data set stored in Swift plus the metadata required to coordinate replication.

Each datastore implementation will need to implement these methods. The content of the image uploaded to swift is opaque to the taskmanager and higher components, so the guest agent is free to store whatever data it chooses, in whichever format is most appropriate. The content of the metadata is specific to the datastore, but will be stored as a JSON object.

Trove Guestagent - MySQL Datastore Implementation