Allow incremental recovery
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / yang / distributed-datastore-provider.yang
1 // vi: set smarttab et sw=4 tabstop=4:
2 module distributed-datastore-provider {
3
4     yang-version 1;
5     namespace "urn:opendaylight:params:xml:ns:yang:controller:config:distributed-datastore-provider";
6     prefix "distributed-datastore-provider";
7
8     description
9         "This module contains the base YANG definitions for
10         the distributed datastore provider implementation";
11
12     revision "2014-06-12" {
13         description
14             "Initial revision.";
15     }
16
17     typedef non-zero-uint32-type {
18         type uint32 {
19             range "1..max";
20         }
21     }
22
23     typedef operation-timeout-type {
24         type uint16 {
25             range "5..max";
26         }
27     }
28
29     typedef heartbeat-interval-type {
30         type uint16 {
31             range "100..max";
32         }
33     }
34
35     typedef percentage {
36         type uint8 {
37             range "0..100";
38         }
39     }
40
41     grouping data-store-properties {
42         leaf max-shard-data-change-executor-queue-size {
43             default 1000;
44             type non-zero-uint32-type;
45             description "The maximum queue size for each shard's data store data change notification executor.";
46         }
47
48         leaf max-shard-data-change-executor-pool-size {
49             default 20;
50             type non-zero-uint32-type;
51             description "The maximum thread pool size for each shard's data store data change notification executor.";
52         }
53
54         leaf max-shard-data-change-listener-queue-size {
55             default 1000;
56             type non-zero-uint32-type;
57             description "The maximum queue size for each shard's data store data change listener.";
58         }
59
60         leaf max-shard-data-store-executor-queue-size {
61             default 5000;
62             type non-zero-uint32-type;
63             description "The maximum queue size for each shard's data store executor.";
64         }
65
66         leaf shard-transaction-idle-timeout-in-minutes {
67             default 10;
68             type non-zero-uint32-type;
69             description "The maximum amount of time a shard transaction can be idle without receiving any messages before it self-destructs.";
70         }
71
72         leaf shard-snapshot-batch-count {
73             default 20000;
74             type non-zero-uint32-type;
75             description "The minimum number of entries to be present in the in-memory journal log before a snapshot is to be taken.";
76         }
77
78         leaf shard-snapshot-data-threshold-percentage {
79             default 12;
80             type percentage;
81             description "The percentage of Runtime.maxMemory() used by the in-memory journal log before a snapshot is to be taken";
82         }
83
84
85         leaf shard-heartbeat-interval-in-millis {
86             default 500;
87             type heartbeat-interval-type;
88             description "The interval at which a shard will send a heart beat message to its remote shard.";
89         }
90
91         leaf shard-election-timeout-factor {
92             default 20;
93             type non-zero-uint32-type;
94             description "The multiplication factor to be used to determine shard election timeout. The shard election timeout
95                          is determined by multiplying shard-heartbeat-interval-in-millis with the shard-election-timeout-factor";
96         }
97
98         leaf operation-timeout-in-seconds {
99             default 5;
100             type operation-timeout-type;
101             description "The maximum amount of time for akka operations (remote or local) to complete before failing.";
102         }
103
104         leaf shard-journal-recovery-log-batch-size {
105             default 1;
106             type non-zero-uint32-type;
107             description "The maximum number of journal log entries to batch on recovery for a shard before committing to the data store.";
108         }
109
110         leaf shard-transaction-commit-timeout-in-seconds {
111             default 30;
112             type non-zero-uint32-type;
113             description "The maximum amount of time a shard transaction three-phase commit can be idle without receiving the next messages before it aborts the transaction";
114         }
115
116         leaf shard-transaction-commit-queue-capacity {
117             default 50000;
118             type non-zero-uint32-type;
119             description "The maximum allowed capacity for each shard's transaction commit queue.";
120         }
121
122         leaf shard-commit-queue-expiry-timeout-in-seconds {
123             default 120; // 2 minutes
124             type non-zero-uint32-type;
125             description "The maximum amount of time a transaction can remain in a shard's commit queue waiting
126                 to begin the CanCommit phase as coordinated by the broker front-end. Normally this should be
127                 quick but latencies can occur in between transaction ready and CanCommit or a remote broker
128                 could lose connection and CanCommit might never occur. Expiring transactions from the queue
129                 allows subsequent pending transaction to be processed.";
130         }
131
132         leaf shard-initialization-timeout-in-seconds {
133             default 300; // 5 minutes
134             type non-zero-uint32-type;
135             description "The maximum amount of time to wait for a shard to initialize from persistence
136                          on startup before failing an operation (eg transaction create and change
137                          listener registration).";
138         }
139
140         leaf shard-leader-election-timeout-in-seconds {
141             default 30;
142             type non-zero-uint32-type;
143             description "The maximum amount of time to wait for a shard to elect a leader before failing
144                           an operation (eg transaction create).";
145         }
146
147         leaf initial-settle-timeout-multiplier {
148             default 3;
149             type uint32;
150             description "Multiplier for the maximum amount of time to wait for a shard to elect a leader.
151                          Zero value means wait indefinitely (as long as it takes).";
152         }
153
154         leaf recovery-snapshot-interval-seconds {
155             default 0;
156             type uint32;
157             description "Interval after which a snapshot should be taken during the recovery process.";
158         }
159
160         leaf shard-batched-modification-count {
161             default 1000;
162             type non-zero-uint32-type;
163             description "The number of transaction modification operations (put, merge, delete) to
164                         batch before sending to the shard transaction actor. Batching improves
165                         performance as less modifications messages are sent to the actor and thus
166                         lessens the chance that the transaction actor's mailbox queue could get full.";
167         }
168
169         leaf enable-metric-capture {
170             default false;
171             type boolean;
172             description "Enable or disable metric capture.";
173         }
174
175         leaf bounded-mailbox-capacity {
176             default 1000;
177             type non-zero-uint32-type;
178             description "Max queue size that an actor's mailbox can reach";
179         }
180
181         leaf persistent {
182             default true;
183             type boolean;
184             description "Enable or disable data persistence";
185         }
186
187         leaf shard-isolated-leader-check-interval-in-millis {
188             default 5000;
189             type heartbeat-interval-type;
190             description "The interval at which the leader of the shard will check if its majority
191                         followers are active and term itself as isolated";
192         }
193
194         leaf transaction-creation-initial-rate-limit {
195             default 100;
196             type non-zero-uint32-type;
197             description "The initial number of transactions per second that are allowed before the data store
198                          should begin applying back pressure. This number is only used as an initial guidance,
199                          subsequently the datastore measures the latency for a commit and auto-adjusts the rate limit";
200         }
201
202         leaf transaction-debug-context-enabled {
203             default false;
204             type boolean;
205             description "Enable or disable transaction context debug. This will log the call site trace for
206                          transactions that fail";
207         }
208
209         leaf custom-raft-policy-implementation {
210             default "";
211             type string;
212             description "A fully qualified java class name. The class should implement
213                          org.opendaylight.controller.cluster.raft.policy.RaftPolicy. This java class should be
214                          accessible to the distributed data store OSGi module so that it can be dynamically loaded via
215                          reflection. For now let's assume that these classes to customize raft behaviors should be
216                          present in the distributed data store module itself. If this property is set to a class which
217                          cannot be found then the default raft behavior will be applied";
218         }
219
220         leaf shard-snapshot-chunk-size {
221             status deprecated;
222             default 2048000;
223             type non-zero-uint32-type;
224             description "When sending a snapshot to a follower, this is the maximum size in bytes for
225                          a chunk of data.";
226         }
227
228         leaf maximum-message-slice-size {
229             default 2048000;
230             type non-zero-uint32-type;
231             description "When fragmenting messages thru the akka remoting framework, this is the
232                          maximum size in bytes for a message slice.";
233         }
234
235         leaf use-tell-based-protocol {
236             default false;
237             type boolean;
238             description "Use a newer protocol between the frontend and backend. This feature is considered
239                          exprerimental at this point.";
240         }
241
242         leaf file-backed-streaming-threshold-in-megabytes {
243             default 128;
244             type non-zero-uint32-type;
245             description "When streaming large amounts of data, eg when sending a snapshot to a follower, this
246                 is the threshold in terms of number of megabytes before it should switch from storing in memory to
247                 buffering to a file.";
248         }
249
250         leaf sync-index-threshold {
251             default 10;
252             type non-zero-uint32-type;
253             description "Permitted synchronization lag, expressed in terms of RAFT entry count. It a follower's
254                          commitIndex trails the leader's journal by more than this amount of entries the follower
255                          is considered to be out-of-sync.";
256         }
257
258         leaf backend-aliveness-timer-interval-in-seconds {
259             default 30;
260             type non-zero-uint32-type;
261             description "The timer interval whereby, on expiration after response inactivity from the back-end,
262                         the connection to the back-end is torn down and reconnection is attempted.";
263         }
264
265         leaf frontend-request-timeout-in-seconds {
266             default 120; // 2 minutes
267             type non-zero-uint32-type;
268             description "The timeout interval whereby client frontend transaction requests are failed.";
269         }
270
271         leaf frontend-no-progress-timeout-in-seconds {
272             default 900; // 15 minutes
273             type non-zero-uint32-type;
274             description "The timeout interval whereby the client front-end hasn't made progress with the
275                          back-end on any request and terminates.";
276         }
277
278         leaf initial-payload-serialized-buffer-capacity {
279             default 512;
280             type non-zero-uint32-type;
281             description "The initial buffer capacity, in bytes, to use when serializing message payloads.";
282         }
283     }
284
285     container data-store-properties-container {
286         uses data-store-properties;
287     }
288 }