Add direct in-memory journal threshold
[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                          Disabled, if direct threshold is enabled.";
83         }
84
85         leaf shard-snapshot-data-threshold {
86             default 0;
87             type uint32 {
88                 range "0..max";
89             }
90             description "The threshold of in-memory journal size before a snapshot is to be taken. If set to 0, direct threshold
91                          is disabled and percentage is used instead.";
92         }
93
94
95         leaf shard-heartbeat-interval-in-millis {
96             default 500;
97             type heartbeat-interval-type;
98             description "The interval at which a shard will send a heart beat message to its remote shard.";
99         }
100
101         leaf shard-election-timeout-factor {
102             default 20;
103             type non-zero-uint32-type;
104             description "The multiplication factor to be used to determine shard election timeout. The shard election timeout
105                          is determined by multiplying shard-heartbeat-interval-in-millis with the shard-election-timeout-factor";
106         }
107
108         leaf operation-timeout-in-seconds {
109             default 5;
110             type operation-timeout-type;
111             description "The maximum amount of time for akka operations (remote or local) to complete before failing.";
112         }
113
114         leaf shard-journal-recovery-log-batch-size {
115             default 1;
116             type non-zero-uint32-type;
117             description "The maximum number of journal log entries to batch on recovery for a shard before committing to the data store.";
118         }
119
120         leaf shard-transaction-commit-timeout-in-seconds {
121             default 30;
122             type non-zero-uint32-type;
123             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";
124         }
125
126         leaf shard-transaction-commit-queue-capacity {
127             default 50000;
128             type non-zero-uint32-type;
129             description "The maximum allowed capacity for each shard's transaction commit queue.";
130         }
131
132         leaf shard-commit-queue-expiry-timeout-in-seconds {
133             default 120; // 2 minutes
134             type non-zero-uint32-type;
135             description "The maximum amount of time a transaction can remain in a shard's commit queue waiting
136                 to begin the CanCommit phase as coordinated by the broker front-end. Normally this should be
137                 quick but latencies can occur in between transaction ready and CanCommit or a remote broker
138                 could lose connection and CanCommit might never occur. Expiring transactions from the queue
139                 allows subsequent pending transaction to be processed.";
140         }
141
142         leaf shard-initialization-timeout-in-seconds {
143             default 300; // 5 minutes
144             type non-zero-uint32-type;
145             description "The maximum amount of time to wait for a shard to initialize from persistence
146                          on startup before failing an operation (eg transaction create and change
147                          listener registration).";
148         }
149
150         leaf shard-leader-election-timeout-in-seconds {
151             default 30;
152             type non-zero-uint32-type;
153             description "The maximum amount of time to wait for a shard to elect a leader before failing
154                           an operation (eg transaction create).";
155         }
156
157         leaf initial-settle-timeout-multiplier {
158             default 3;
159             type uint32;
160             description "Multiplier for the maximum amount of time to wait for a shard to elect a leader.
161                          Zero value means wait indefinitely (as long as it takes).";
162         }
163
164         leaf recovery-snapshot-interval-seconds {
165             default 0;
166             type uint32;
167             description "Interval after which a snapshot should be taken during the recovery process.";
168         }
169
170         leaf shard-batched-modification-count {
171             default 1000;
172             type non-zero-uint32-type;
173             description "The number of transaction modification operations (put, merge, delete) to
174                         batch before sending to the shard transaction actor. Batching improves
175                         performance as less modifications messages are sent to the actor and thus
176                         lessens the chance that the transaction actor's mailbox queue could get full.";
177         }
178
179         leaf enable-metric-capture {
180             default false;
181             type boolean;
182             description "Enable or disable metric capture.";
183         }
184
185         leaf bounded-mailbox-capacity {
186             default 1000;
187             type non-zero-uint32-type;
188             description "Max queue size that an actor's mailbox can reach";
189         }
190
191         leaf persistent {
192             default true;
193             type boolean;
194             description "Enable or disable data persistence";
195         }
196
197         leaf snapshotOnRootOverwrite {
198             default false;
199             type boolean;
200             description "Enable or disable capturing snapshots on DataTree root overwrites";
201         }
202
203         leaf shard-isolated-leader-check-interval-in-millis {
204             default 5000;
205             type heartbeat-interval-type;
206             description "The interval at which the leader of the shard will check if its majority
207                         followers are active and term itself as isolated";
208         }
209
210         leaf transaction-creation-initial-rate-limit {
211             default 100;
212             type non-zero-uint32-type;
213             description "The initial number of transactions per second that are allowed before the data store
214                          should begin applying back pressure. This number is only used as an initial guidance,
215                          subsequently the datastore measures the latency for a commit and auto-adjusts the rate limit";
216         }
217
218         leaf transaction-debug-context-enabled {
219             default false;
220             type boolean;
221             description "Enable or disable transaction context debug. This will log the call site trace for
222                          transactions that fail";
223         }
224
225         leaf custom-raft-policy-implementation {
226             default "";
227             type string;
228             description "A fully qualified java class name. The class should implement
229                          org.opendaylight.controller.cluster.raft.policy.RaftPolicy. This java class should be
230                          accessible to the distributed data store OSGi module so that it can be dynamically loaded via
231                          reflection. For now let's assume that these classes to customize raft behaviors should be
232                          present in the distributed data store module itself. If this property is set to a class which
233                          cannot be found then the default raft behavior will be applied";
234         }
235
236         leaf shard-snapshot-chunk-size {
237             status deprecated;
238             default 2048000;
239             type non-zero-uint32-type;
240             description "When sending a snapshot to a follower, this is the maximum size in bytes for
241                          a chunk of data.";
242         }
243
244         leaf maximum-message-slice-size {
245             default 2048000;
246             type non-zero-uint32-type;
247             description "When fragmenting messages thru the akka remoting framework, this is the
248                          maximum size in bytes for a message slice.";
249         }
250
251         leaf use-tell-based-protocol {
252             default false;
253             type boolean;
254             description "Use a newer protocol between the frontend and backend. This feature is considered
255                          exprerimental at this point.";
256         }
257
258         leaf file-backed-streaming-threshold-in-megabytes {
259             default 128;
260             type non-zero-uint32-type;
261             description "When streaming large amounts of data, eg when sending a snapshot to a follower, this
262                 is the threshold in terms of number of megabytes before it should switch from storing in memory to
263                 buffering to a file.";
264         }
265
266         leaf sync-index-threshold {
267             default 10;
268             type non-zero-uint32-type;
269             description "Permitted synchronization lag, expressed in terms of RAFT entry count. It a follower's
270                          commitIndex trails the leader's journal by more than this amount of entries the follower
271                          is considered to be out-of-sync.";
272         }
273
274         leaf backend-aliveness-timer-interval-in-seconds {
275             default 30;
276             type non-zero-uint32-type;
277             description "The timer interval whereby, on expiration after response inactivity from the back-end,
278                         the connection to the back-end is torn down and reconnection is attempted.";
279         }
280
281         leaf frontend-request-timeout-in-seconds {
282             default 120; // 2 minutes
283             type non-zero-uint32-type;
284             description "The timeout interval whereby client frontend transaction requests are failed.";
285         }
286
287         leaf frontend-no-progress-timeout-in-seconds {
288             default 900; // 15 minutes
289             type non-zero-uint32-type;
290             description "The timeout interval whereby the client front-end hasn't made progress with the
291                          back-end on any request and terminates.";
292         }
293
294         leaf initial-payload-serialized-buffer-capacity {
295             default 512;
296             type non-zero-uint32-type;
297             description "The initial buffer capacity, in bytes, to use when serializing message payloads.";
298         }
299
300         leaf use-lz4-compression {
301             default false;
302             type boolean;
303             description "Use lz4 compression for snapshots, sent from leader to follower, for snapshots stored
304                         by LocalSnapshotStore, use akka.conf configuration.";
305         }
306     }
307
308     container data-store-properties-container {
309         uses data-store-properties;
310     }
311 }