summaryrefslogtreecommitdiff
path: root/storage/ndb/src/old_files/rep/README
blob: 7be5e230eb3f27a4669a05295fd33874ee5dcd5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
                ===========================================
                         MySQL Replication Servers
                     Lars Thalmann and Johan Andersson
                              2003 MySQL AB
                ===========================================
 
-------------------------------------------------------------------------------

                PRIMARY SYSTEM               STANDBY SYSTEM 
              REPLICATION SERVER           REPLICATION SERVER
             (PS or SOURCE SYSTEM)     (SS or DESTINATION SYSTEM)
             +------------------+     +-------------------------+
             |     RepMain      |     |    RepMain [Requests]   |
             |                  |     +-------------------------+
             |                  |     |   Requestor [Executes]  |
             +------------------+     +-------------------------+
      PS --- | ExtNDB | TransPS | --- |   TransSS  |  AppNDB    | --- SS
             +------------------+     +-------------------------+
                (GCIContainer)               (GCIContainer)
                                               (RepState)

                      Figure 1: Replication Server Threads 

Component List
--------------
RepMain
  Main thread that runs command-line interpreter [Requests]

Requestor
  Thread that runs RepState::execute [Executes]

ExtNDB
  Extracts transaction epochs from NDB Cluster

TransPS, TransSS
  Transfers information (control and epoch buffers) between 
  Replication Servers.

AppNDB
  Applies transaction epochs to NDB Cluster

-------------------------------------------------------------------------------

               RepState Control
                    Object
             +------------------+    
             |     RepState     |    
             |    [Requests]    |    
             |    [Executes]    |    
             +------------------+    
             |  RepStateRequest | --- ExtSender
             +------------------+ 

                      Figure 2: RepState Object


The RepState object is shared by all components.


-------------------------------------------------------------------------------

Dependent Directories
---------------------
rep/adapters    Appliers and Extractors
  All code dependent on the database system

rep/transfer
  Depends on NDB transporters

rep/state
  Shared resources for all components

Independent Directories
-----------------------
rep/storage     Storage of epochs 
  Should not depend on any transporters/NDB specific

rep/repstate
  Should only have a reference to an ExtSender for the external PS REP node


-------------------------------------------------------------------------------

Replication Teminology
----------------------
GLOBAL CHECKPOINT <global checkpoint id - gci>
A global checkpoint is a point in time when all database server
are synchronized.

NODE
A database server with information.

NODE GROUP <node group id>
A set of database servers, all storing the same information.

SUBSCRIPTION <subscription id>.
A "subscription" is a collection of services that a source system 
provides.  The main to services belonging to a subscription are 
"log" and "scan".  Log provides the replication servers with 
log entries (epochs) and scan provides the replication servers
with scanned data (also stored in epochs).

EPOCH <subscription id, gci>
An "epoch" is a log of all database changes between two time points.
(An epoch can have redundant log entries.)  An epoch is named by the
number of the time slice between the two time points.

EPOCH BUFFER <subscription id, gci, node group id>
An "epoch buffer" is a part of the log belonging to an epoch.  An
epoch buffer does not contain any redundancy.  

Two epoch buffers with the same subscription id and gci can be
"complements" or "duplicates" to each other.  If they are complements,
they store different information, if they are duplicates then they
store equivalent information (the information need not be identical,
but it is equivalent for the purpose of restoring the original
information).  If they are duplicates then they have the same name,
i.e. same subscription id, gci, and node group id.

CHANNEL <subscription id>
A "channel" is a collection of epoch buffers belonging to
a specific subscription.  (The channel can exist before it is 
assigned to a subscription.)

SUBSCRIPTION CONSISTENT
A database is "subscription consistent" or "consistent with respect
to a subscription" if ...

Architectural Terminology
-------------------------
ADAPTER
An "adapter" is either an applier or an extractor.

APPLIER 
An "applier" is a a collection of threads in the replication server
that applies epochs to a destination database system.

EXTRACTOR
An "extractor" is a collection of theads in the replication server
that receives epochs from a source database system.

TRANSFER COMPONENT 
A "transfer component" is a thread in the replication server that is
responsible for the connection with another replication server.

REQUESTOR 
A thread in the replication server that controls replication.