/
api_data.py
1622 lines (1556 loc) · 76.8 KB
/
api_data.py
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# This file is a python script that describes the WiredTiger API.
class Method:
def __init__(self, config):
# Deal with duplicates: with complex configurations (like
# WT_SESSION::create), it's simpler to deal with duplicates once than
# manually as configurations are defined
self.config = []
lastname = None
for c in sorted(config):
if '.' in c.name:
raise "Bad config key '%s'" % c.name
if c.name == lastname:
continue
lastname = c.name
self.config.append(c)
class Config:
def __init__(self, name, default, desc, subconfig=None, **flags):
self.name = name
self.default = default
self.desc = desc
self.subconfig = subconfig
self.flags = flags
# Comparators for sorting.
def __eq__(self, other):
return self.name == other.name
def __ne__(self, other):
return self.name != other.name
def __lt__(self, other):
return self.name < other.name
def __le__(self, other):
return self.name <= other.name
def __gt__(self, other):
return self.name > other.name
def __ge__(self, other):
return self.name >= other.name
common_runtime_config = [
Config('app_metadata', '', r'''
application-owned metadata for this object'''),
]
# Metadata shared by all schema objects
common_meta = common_runtime_config + [
Config('collator', 'none', r'''
configure custom collation for keys. Permitted values are \c "none"
or a custom collator name created with WT_CONNECTION::add_collator'''),
Config('columns', '', r'''
list of the column names. Comma-separated list of the form
<code>(column[,...])</code>. For tables, the number of entries
must match the total number of values in \c key_format and \c
value_format. For colgroups and indices, all column names must
appear in the list of columns for the table''',
type='list'),
]
source_meta = [
Config('source', '', r'''
set a custom data source URI for a column group, index or simple
table. By default, the data source URI is derived from the \c
type and the column group or index name. Applications can
create tables from existing data sources by supplying a \c
source configuration''', undoc=True),
Config('type', 'file', r'''
set the type of data source used to store a column group, index
or simple table. By default, a \c "file:" URI is derived from
the object name. The \c type configuration can be used to
switch to a different data source, such as LSM or an extension
configured by the application'''),
]
format_meta = common_meta + [
Config('key_format', 'u', r'''
the format of the data packed into key items. See @ref
schema_format_types for details. By default, the key_format is
\c 'u' and applications use WT_ITEM structures to manipulate
raw byte arrays. By default, records are stored in row-store
files: keys of type \c 'r' are record numbers and records
referenced by record number are stored in column-store files''',
type='format', func='__wt_struct_confchk'),
Config('value_format', 'u', r'''
the format of the data packed into value items. See @ref
schema_format_types for details. By default, the value_format
is \c 'u' and applications use a WT_ITEM structure to
manipulate raw byte arrays. Value items of type 't' are
bitfields, and when configured with record number type keys,
will be stored using a fixed-length store''',
type='format', func='__wt_struct_confchk'),
]
lsm_config = [
Config('lsm', '', r'''
options only relevant for LSM data sources''',
type='category', subconfig=[
Config('auto_throttle', 'true', r'''
Throttle inserts into LSM trees if flushing to disk isn't
keeping up''',
type='boolean'),
Config('bloom', 'true', r'''
create bloom filters on LSM tree chunks as they are merged''',
type='boolean'),
Config('bloom_bit_count', '16', r'''
the number of bits used per item for LSM bloom filters''',
min='2', max='1000'),
Config('bloom_config', '', r'''
config string used when creating Bloom filter files, passed
to WT_SESSION::create'''),
Config('bloom_hash_count', '8', r'''
the number of hash values per item used for LSM bloom
filters''',
min='2', max='100'),
Config('bloom_oldest', 'false', r'''
create a bloom filter on the oldest LSM tree chunk. Only
supported if bloom filters are enabled''',
type='boolean'),
Config('chunk_count_limit', '0', r'''
the maximum number of chunks to allow in an LSM tree. This
option automatically times out old data. As new chunks are
added old chunks will be removed. Enabling this option
disables LSM background merges''',
type='int'),
Config('chunk_max', '5GB', r'''
the maximum size a single chunk can be. Chunks larger than this
size are not considered for further merges. This is a soft
limit, and chunks larger than this value can be created. Must
be larger than chunk_size''',
min='100MB', max='10TB'),
Config('chunk_size', '10MB', r'''
the maximum size of the in-memory chunk of an LSM tree. This
limit is soft - it is possible for chunks to be temporarily
larger than this value. This overrides the \c memory_page_max
setting''',
min='512K', max='500MB'),
Config('merge_custom', '', r'''
configure the tree to merge into a custom data source''',
type='category', subconfig=[
Config('prefix', '', r'''
custom data source prefix instead of \c "file"'''),
Config('start_generation', '0', r'''
merge generation at which the custom data source is used
(zero indicates no custom data source)''',
min='0', max='10'),
Config('suffix', '', r'''
custom data source suffix instead of \c ".lsm"'''),
]),
Config('merge_max', '15', r'''
the maximum number of chunks to include in a merge operation''',
min='2', max='100'),
Config('merge_min', '0', r'''
the minimum number of chunks to include in a merge operation. If
set to 0 or 1 half the value of merge_max is used''',
max='100'),
]),
]
file_runtime_config = common_runtime_config + [
Config('access_pattern_hint', 'none', r'''
It is recommended that workloads that consist primarily of
updates and/or point queries specify \c random. Workloads that
do many cursor scans through large ranges of data specify
\c sequential and other workloads specify \c none. The
option leads to an advisory call to an appropriate operating
system API where available''',
choices=['none', 'random', 'sequential']),
Config('assert', '', r'''
enable enhanced checking. ''',
type='category', subconfig= [
Config('commit_timestamp', 'none', r'''
verify that timestamps should 'always' or 'never' be used
on modifications with this table. Verification is 'none'
if mixed update use is allowed. If 'key_consistent' is
set then all updates to a specific key must be the same
with respect to timestamp usage or not.''',
choices=['always', 'key_consistent', 'never', 'none']),
Config('durable_timestamp', 'none', r'''
verify that durable timestamps should 'always' or 'never' be used
on modifications with this table.''',
choices=['always', 'key_consistent', 'never', 'none']),
Config('read_timestamp', 'none', r'''
verify that timestamps should 'always' or 'never' be used
on reads with this table. Verification is 'none'
if mixed read use is allowed.''',
choices=['always', 'never', 'none'])
], undoc=True),
Config('cache_resident', 'false', r'''
do not ever evict the object's pages from cache. Not compatible with
LSM tables; see @ref tuning_cache_resident for more information''',
type='boolean'),
Config('log', '', r'''
the transaction log configuration for this object. Only valid if
log is enabled in ::wiredtiger_open''',
type='category', subconfig=[
Config('enabled', 'true', r'''
if false, this object has checkpoint-level durability''',
type='boolean'),
]),
Config('os_cache_max', '0', r'''
maximum system buffer cache usage, in bytes. If non-zero, evict
object blocks from the system buffer cache after that many bytes
from this object are read or written into the buffer cache''',
min=0),
Config('os_cache_dirty_max', '0', r'''
maximum dirty system buffer cache usage, in bytes. If non-zero,
schedule writes for dirty blocks belonging to this object in the
system buffer cache after that many bytes from this object are
written into the buffer cache''',
min=0),
]
# Per-file configuration
file_config = format_meta + file_runtime_config + [
Config('block_allocation', 'best', r'''
configure block allocation. Permitted values are \c "first" or
\c "best"; the \c "first" configuration uses a first-available
algorithm during block allocation, the \c "best" configuration
uses a best-fit algorithm''',
choices=['first', 'best',]),
Config('allocation_size', '4KB', r'''
the file unit allocation size, in bytes, must a power-of-two;
smaller values decrease the file space required by overflow
items, and the default value of 4KB is a good choice absent
requirements from the operating system or storage device''',
min='512B', max='128MB'),
Config('block_compressor', 'none', r'''
configure a compressor for file blocks. Permitted values are \c "none"
or custom compression engine name created with
WT_CONNECTION::add_compressor. If WiredTiger has builtin support for
\c "lz4", \c "snappy", \c "zlib" or \c "zstd" compression, these names
are also available. See @ref compression for more information'''),
Config('checksum', 'uncompressed', r'''
configure block checksums; permitted values are <code>on</code>
(checksum all blocks), <code>off</code> (checksum no blocks) and
<code>uncompresssed</code> (checksum only blocks which are not
compressed for any reason). The \c uncompressed setting is for
applications which can rely on decompression to fail if a block
has been corrupted''',
choices=['on', 'off', 'uncompressed']),
Config('dictionary', '0', r'''
the maximum number of unique values remembered in the Btree
row-store leaf page value dictionary; see
@ref file_formats_compression for more information''',
min='0'),
Config('encryption', '', r'''
configure an encryptor for file blocks. When a table is created,
its encryptor is not implicitly used for any related indices
or column groups''',
type='category', subconfig=[
Config('name', 'none', r'''
Permitted values are \c "none"
or custom encryption engine name created with
WT_CONNECTION::add_encryptor.
See @ref encryption for more information'''),
Config('keyid', '', r'''
An identifier that identifies a unique instance of the encryptor.
It is stored in clear text, and thus is available when
the wiredtiger database is reopened. On the first use
of a (name, keyid) combination, the WT_ENCRYPTOR::customize
function is called with the keyid as an argument'''),
]),
Config('format', 'btree', r'''
the file format''',
choices=['btree']),
Config('huffman_key', 'none', r'''
configure Huffman encoding for keys. Permitted values are
\c "none", \c "english", \c "utf8<file>" or \c "utf16<file>".
See @ref huffman for more information'''),
Config('huffman_value', 'none', r'''
configure Huffman encoding for values. Permitted values are
\c "none", \c "english", \c "utf8<file>" or \c "utf16<file>".
See @ref huffman for more information'''),
Config('ignore_in_memory_cache_size', 'false', r'''
allow update and insert operations to proceed even if the cache is
already at capacity. Only valid in conjunction with in-memory
databases. Should be used with caution - this configuration allows
WiredTiger to consume memory over the configured cache limit''',
type='boolean'),
Config('internal_key_truncate', 'true', r'''
configure internal key truncation, discarding unnecessary trailing
bytes on internal keys (ignored for custom collators)''',
type='boolean'),
Config('internal_page_max', '4KB', r'''
the maximum page size for internal nodes, in bytes; the size
must be a multiple of the allocation size and is significant
for applications wanting to avoid excessive L2 cache misses
while searching the tree. The page maximum is the bytes of
uncompressed data, that is, the limit is applied before any
block compression is done''',
min='512B', max='512MB'),
Config('internal_item_max', '0', r'''
historic term for internal_key_max''',
min=0, undoc=True),
Config('internal_key_max', '0', r'''
the largest key stored in an internal node, in bytes. If set, keys
larger than the specified size are stored as overflow items (which
may require additional I/O to access). The default and the maximum
allowed value are both one-tenth the size of a newly split internal
page''',
min='0'),
Config('key_gap', '10', r'''
the maximum gap between instantiated keys in a Btree leaf page,
constraining the number of keys processed to instantiate a
random Btree leaf page key''',
min='0', undoc=True),
Config('leaf_key_max', '0', r'''
the largest key stored in a leaf node, in bytes. If set, keys
larger than the specified size are stored as overflow items (which
may require additional I/O to access). The default value is
one-tenth the size of a newly split leaf page''',
min='0'),
Config('leaf_page_max', '32KB', r'''
the maximum page size for leaf nodes, in bytes; the size must
be a multiple of the allocation size, and is significant for
applications wanting to maximize sequential data transfer from
a storage device. The page maximum is the bytes of uncompressed
data, that is, the limit is applied before any block compression
is done''',
min='512B', max='512MB'),
Config('leaf_value_max', '0', r'''
the largest value stored in a leaf node, in bytes. If set, values
larger than the specified size are stored as overflow items (which
may require additional I/O to access). If the size is larger than
the maximum leaf page size, the page size is temporarily ignored
when large values are written. The default is one-half the size of
a newly split leaf page''',
min='0'),
Config('leaf_item_max', '0', r'''
historic term for leaf_key_max and leaf_value_max''',
min=0, undoc=True),
Config('memory_page_image_max', '0', r'''
the maximum in-memory page image represented by a single storage block.
Depending on compression efficiency, compression can create storage
blocks which require significant resources to re-instantiate in the
cache, penalizing the performance of future point updates. The value
limits the maximum in-memory page image a storage block will need. If
set to 0, a default of 4 times \c leaf_page_max is used''',
min='0'),
Config('memory_page_max', '5MB', r'''
the maximum size a page can grow to in memory before being
reconciled to disk. The specified size will be adjusted to a lower
bound of <code>leaf_page_max</code>, and an upper bound of
<code>cache_size / 10</code>. This limit is soft - it is possible
for pages to be temporarily larger than this value. This setting
is ignored for LSM trees, see \c chunk_size''',
min='512B', max='10TB'),
Config('prefix_compression', 'false', r'''
configure prefix compression on row-store leaf pages''',
type='boolean'),
Config('prefix_compression_min', '4', r'''
minimum gain before prefix compression will be used on row-store
leaf pages''',
min=0),
Config('split_deepen_min_child', '0', r'''
minimum entries in a page to consider deepening the tree. Pages
will be considered for splitting and deepening the search tree
as soon as there are more than the configured number of children
''',
type='int', undoc=True),
Config('split_deepen_per_child', '0', r'''
entries allocated per child when deepening the tree''',
type='int', undoc=True),
Config('split_pct', '90', r'''
the Btree page split size as a percentage of the maximum Btree
page size, that is, when a Btree page is split, it will be
split into smaller pages, where each page is the specified
percentage of the maximum Btree page size''',
min='50', max='100'),
]
# File metadata, including both configurable and non-configurable (internal)
file_meta = file_config + [
Config('checkpoint', '', r'''
the file checkpoint entries'''),
Config('checkpoint_lsn', '', r'''
LSN of the last checkpoint'''),
Config('id', '', r'''
the file's ID number'''),
Config('version', '(major=0,minor=0)', r'''
the file version'''),
]
lsm_meta = file_config + lsm_config + [
Config('last', '', r'''
the last allocated chunk ID'''),
Config('chunks', '', r'''
active chunks in the LSM tree'''),
Config('old_chunks', '', r'''
obsolete chunks in the LSM tree'''),
]
table_only_config = [
Config('colgroups', '', r'''
comma-separated list of names of column groups. Each column
group is stored separately, keyed by the primary key of the
table. If no column groups are specified, all columns are
stored together in a single file. All value columns in the
table must appear in at least one column group. Each column
group must be created with a separate call to
WT_SESSION::create''', type='list'),
]
index_only_config = [
Config('extractor', 'none', r'''
configure custom extractor for indices. Permitted values are
\c "none" or an extractor name created with
WT_CONNECTION::add_extractor'''),
Config('immutable', 'false', r'''
configure the index to be immutable - that is an index is not changed
by any update to a record in the table''', type='boolean'),
]
colgroup_meta = common_meta + source_meta
index_meta = format_meta + source_meta + index_only_config + [
Config('index_key_columns', '', r'''
number of public key columns''', type='int', undoc=True),
]
table_meta = format_meta + table_only_config
# Connection runtime config, shared by conn.reconfigure and wiredtiger_open
connection_runtime_config = [
Config('async', '', r'''
asynchronous operations configuration options''',
type='category', subconfig=[
Config('enabled', 'false', r'''
enable asynchronous operation''',
type='boolean'),
Config('ops_max', '1024', r'''
maximum number of expected simultaneous asynchronous
operations''', min='1', max='4096'),
Config('threads', '2', r'''
the number of worker threads to service asynchronous requests.
Each worker thread uses a session from the configured
session_max''',
min='1', max='20'), # !!! Must match WT_ASYNC_MAX_WORKERS
]),
Config('cache_size', '100MB', r'''
maximum heap memory to allocate for the cache. A database should
configure either \c cache_size or \c shared_cache but not both''',
min='1MB', max='10TB'),
Config('cache_max_wait_ms', '0', r'''
the maximum number of milliseconds an application thread will wait
for space to be available in cache before giving up. Default will
wait forever''',
min=0),
Config('cache_overflow', '', r'''
cache overflow configuration options''',
type='category', subconfig=[
Config('file_max', '0', r'''
The maximum number of bytes that WiredTiger is allowed to use for
its cache overflow mechanism. If the cache overflow file exceeds
this size, a panic will be triggered. The default value means that
the cache overflow file is unbounded and may use as much space as
the filesystem will accommodate. The minimum non-zero setting is
100MB.''', # !!! Must match WT_LAS_FILE_MIN
min='0')
]),
Config('cache_overhead', '8', r'''
assume the heap allocator overhead is the specified percentage, and
adjust the cache usage by that amount (for example, if there is 10GB
of data in cache, a percentage of 10 means WiredTiger treats this as
11GB). This value is configurable because different heap allocators
have different overhead and different workloads will have different
heap allocation sizes and patterns, therefore applications may need to
adjust this value based on allocator choice and behavior in measured
workloads''',
min='0', max='30'),
Config('checkpoint', '', r'''
periodically checkpoint the database. Enabling the checkpoint server
uses a session from the configured session_max''',
type='category', subconfig=[
Config('log_size', '0', r'''
wait for this amount of log record bytes to be written to
the log between each checkpoint. If non-zero, this value will
use a minimum of the log file size. A database can configure
both log_size and wait to set an upper bound for checkpoints;
setting this value above 0 configures periodic checkpoints''',
min='0', max='2GB'),
Config('wait', '0', r'''
seconds to wait between each checkpoint; setting this value
above 0 configures periodic checkpoints''',
min='0', max='100000'),
]),
Config('debug_mode', '', r'''
control the settings of various extended debugging features''',
type='category', subconfig=[
Config('checkpoint_retention', '0', r'''
adjust log archiving to retain the log records of this number
of checkpoints. Zero or one means perform normal archiving.''',
min='0', max='1024'),
Config('rollback_error', '0', r'''
return a WT_ROLLBACK error from a transaction operation about
every Nth operation to simulate a collision''',
min='0', max='10M'),
Config('table_logging', 'false', r'''
if true, write transaction related information to the log for all
operations, even operations for tables with logging turned off.
This setting introduces a log format change that may break older
versions of WiredTiger. These operations are informational and
skipped in recovery.''',
type='boolean'),
]),
Config('error_prefix', '', r'''
prefix string for error messages'''),
Config('eviction', '', r'''
eviction configuration options''',
type='category', subconfig=[
Config('threads_max', '8', r'''
maximum number of threads WiredTiger will start to help evict
pages from cache. The number of threads started will vary
depending on the current eviction load. Each eviction worker
thread uses a session from the configured session_max''',
min=1, max=20),
Config('threads_min', '1', r'''
minimum number of threads WiredTiger will start to help evict
pages from cache. The number of threads currently running will
vary depending on the current eviction load''',
min=1, max=20),
]),
Config('eviction_checkpoint_target', '1', r'''
perform eviction at the beginning of checkpoints to bring the dirty
content in cache to this level. It is a percentage of the cache size if
the value is within the range of 0 to 100 or an absolute size when
greater than 100. The value is not allowed to exceed the \c cache_size.
Ignored if set to zero or \c in_memory is \c true''',
min=0, max='10TB'),
Config('eviction_dirty_target', '5', r'''
perform eviction in worker threads when the cache contains at least
this much dirty content. It is a percentage of the cache size if the
value is within the range of 1 to 100 or an absolute size when greater
than 100. The value is not allowed to exceed the \c cache_size.''',
min=1, max='10TB'),
Config('eviction_dirty_trigger', '20', r'''
trigger application threads to perform eviction when the cache contains
at least this much dirty content. It is a percentage of the cache size
if the value is within the range of 1 to 100 or an absolute size when
greater than 100. The value is not allowed to exceed the \c cache_size.
This setting only alters behavior if it is lower than eviction_trigger
''', min=1, max='10TB'),
Config('eviction_target', '80', r'''
perform eviction in worker threads when the cache contains at least
this much content. It is a percentage of the cache size if the value is
within the range of 10 to 100 or an absolute size when greater than 100.
The value is not allowed to exceed the \c cache_size.''',
min=10, max='10TB'),
Config('eviction_trigger', '95', r'''
trigger application threads to perform eviction when the cache contains
at least this much content. It is a percentage of the cache size if the
value is within the range of 10 to 100 or an absolute size when greater
than 100. The value is not allowed to exceed the \c cache_size.''',
min=10, max='10TB'),
Config('file_manager', '', r'''
control how file handles are managed''',
type='category', subconfig=[
Config('close_handle_minimum', '250', r'''
number of handles open before the file manager will look for handles
to close''', min=0),
Config('close_idle_time', '30', r'''
amount of time in seconds a file handle needs to be idle
before attempting to close it. A setting of 0 means that idle
handles are not closed''', min=0, max=100000),
Config('close_scan_interval', '10', r'''
interval in seconds at which to check for files that are
inactive and close them''', min=1, max=100000),
]),
Config('io_capacity', '', r'''
control how many bytes per second are written and read. Exceeding
the capacity results in throttling.''',
type='category', subconfig=[
Config('total', '0', r'''
number of bytes per second available to all subsystems in total.
When set, decisions about what subsystems are throttled, and in
what proportion, are made internally. The minimum non-zero setting
is 1MB.''',
min='0', max='1TB'),
]),
Config('lsm_manager', '', r'''
configure database wide options for LSM tree management. The LSM
manager is started automatically the first time an LSM tree is opened.
The LSM manager uses a session from the configured session_max''',
type='category', subconfig=[
Config('worker_thread_max', '4', r'''
Configure a set of threads to manage merging LSM trees in
the database. Each worker thread uses a session handle from
the configured session_max''',
min='3', # !!! Must match WT_LSM_MIN_WORKERS
max='20'), # !!! Must match WT_LSM_MAX_WORKERS
Config('merge', 'true', r'''
merge LSM chunks where possible''',
type='boolean')
]),
Config('lsm_merge', 'true', r'''
merge LSM chunks where possible (deprecated)''',
type='boolean', undoc=True),
Config('operation_tracking', '', r'''
enable tracking of performance-critical functions. See
@ref operation_tracking for more information''',
type='category', subconfig=[
Config('enabled', 'false', r'''
enable operation tracking subsystem''',
type='boolean'),
Config('path', '"."', r'''
the name of a directory into which operation tracking files are
written. The directory must already exist. If the value is not
an absolute path, the path is relative to the database home
(see @ref absolute_path for more information)'''),
]),
Config('shared_cache', '', r'''
shared cache configuration options. A database should configure
either a cache_size or a shared_cache not both. Enabling a
shared cache uses a session from the configured session_max. A
shared cache can not have absolute values configured for cache
eviction settings''',
type='category', subconfig=[
Config('chunk', '10MB', r'''
the granularity that a shared cache is redistributed''',
min='1MB', max='10TB'),
Config('name', 'none', r'''
the name of a cache that is shared between databases or
\c "none" when no shared cache is configured'''),
Config('quota', '0', r'''
maximum size of cache this database can be allocated from the
shared cache. Defaults to the entire shared cache size''',
type='int'),
Config('reserve', '0', r'''
amount of cache this database is guaranteed to have
available from the shared cache. This setting is per
database. Defaults to the chunk size''', type='int'),
Config('size', '500MB', r'''
maximum memory to allocate for the shared cache. Setting
this will update the value if one is already set''',
min='1MB', max='10TB')
]),
Config('statistics', 'none', r'''
Maintain database statistics, which may impact performance.
Choosing "all" maintains all statistics regardless of cost,
"fast" maintains a subset of statistics that are relatively
inexpensive, "none" turns off all statistics. The "clear"
configuration resets statistics after they are gathered,
where appropriate (for example, a cache size statistic is
not cleared, while the count of cursor insert operations will
be cleared). When "clear" is configured for the database,
gathered statistics are reset each time a statistics cursor
is used to gather statistics, as well as each time statistics
are logged using the \c statistics_log configuration. See
@ref statistics for more information''',
type='list',
choices=['all', 'cache_walk', 'fast', 'none', 'clear', 'tree_walk']),
Config('timing_stress_for_test', '', r'''
enable code that interrupts the usual timing of operations with a goal
of uncovering race conditions and unexpected blocking. This option is
intended for use with internal stress testing of WiredTiger.''',
type='list', undoc=True,
choices=[
'aggressive_sweep', 'checkpoint_slow', 'lookaside_sweep_race',
'split_1', 'split_2', 'split_3', 'split_4', 'split_5', 'split_6',
'split_7', 'split_8']),
Config('verbose', '', r'''
enable messages for various events. Options are given as a
list, such as <code>"verbose=[evictserver,read]"</code>''',
type='list', choices=[
'api',
'block',
'checkpoint',
'checkpoint_progress',
'compact',
'compact_progress',
'error_returns',
'evict',
'evict_stuck',
'evictserver',
'fileops',
'handleops',
'log',
'lookaside',
'lookaside_activity',
'lsm',
'lsm_manager',
'metadata',
'mutex',
'overflow',
'read',
'rebalance',
'reconcile',
'recovery',
'recovery_progress',
'salvage',
'shared_cache',
'split',
'temporary',
'thread_group',
'timestamp',
'transaction',
'verify',
'version',
'write']),
]
# wiredtiger_open and WT_CONNECTION.reconfigure compatibility configurations.
compatibility_configuration_common = [
Config('release', '', r'''
compatibility release version string'''),
]
connection_reconfigure_compatibility_configuration = [
Config('compatibility', '', r'''
set compatibility version of database. Changing the compatibility
version requires that there are no active operations for the duration
of the call.''',
type='category', subconfig=
compatibility_configuration_common)
]
wiredtiger_open_compatibility_configuration = [
Config('compatibility', '', r'''
set compatibility version of database. Changing the compatibility
version requires that there are no active operations for the duration
of the call.''',
type='category', subconfig=
compatibility_configuration_common + [
Config('require_max', '', r'''
required maximum compatibility version of existing data files.
Must be greater than or equal to any release version set in the
\c release setting. Has no effect if creating the database.'''),
Config('require_min', '', r'''
required minimum compatibility version of existing data files.
Must be less than or equal to any release version set in the
\c release setting. Has no effect if creating the database.'''),
]),
]
# wiredtiger_open and WT_CONNECTION.reconfigure log configurations.
log_configuration_common = [
Config('archive', 'true', r'''
automatically archive unneeded log files''',
type='boolean'),
Config('os_cache_dirty_pct', '0', r'''
maximum dirty system buffer cache usage, as a percentage of the
log's \c file_max. If non-zero, schedule writes for dirty blocks
belonging to the log in the system buffer cache after that percentage
of the log has been written into the buffer cache without an
intervening file sync.''',
min='0', max='100'),
Config('prealloc', 'true', r'''
pre-allocate log files''',
type='boolean'),
Config('zero_fill', 'false', r'''
manually write zeroes into log files''',
type='boolean')
]
connection_reconfigure_log_configuration = [
Config('log', '', r'''
enable logging. Enabling logging uses three sessions from the
configured session_max''',
type='category', subconfig=
log_configuration_common)
]
wiredtiger_open_log_configuration = [
Config('log', '', r'''
enable logging. Enabling logging uses three sessions from the
configured session_max''',
type='category', subconfig=
log_configuration_common + [
Config('enabled', 'false', r'''
enable logging subsystem''',
type='boolean'),
Config('compressor', 'none', r'''
configure a compressor for log records. Permitted values are
\c "none" or custom compression engine name created with
WT_CONNECTION::add_compressor. If WiredTiger has builtin support
for \c "lz4", \c "snappy", \c "zlib" or \c "zstd" compression,
these names are also available. See @ref compression for more
information'''),
Config('file_max', '100MB', r'''
the maximum size of log files''',
min='100KB', # !!! Must match WT_LOG_FILE_MIN
max='2GB'), # !!! Must match WT_LOG_FILE_MAX
Config('path', '"."', r'''
the name of a directory into which log files are written. The
directory must already exist. If the value is not an absolute path,
the path is relative to the database home (see @ref absolute_path
for more information)'''),
Config('recover', 'on', r'''
run recovery or error if recovery needs to run after an
unclean shutdown''',
choices=['error', 'on'])
]),
]
# wiredtiger_open and WT_CONNECTION.reconfigure statistics log configurations.
statistics_log_configuration_common = [
Config('json', 'false', r'''
encode statistics in JSON format''',
type='boolean'),
Config('on_close', 'false', r'''log statistics on database close''',
type='boolean'),
Config('sources', '', r'''
if non-empty, include statistics for the list of data source
URIs, if they are open at the time of the statistics logging.
The list may include URIs matching a single data source
("table:mytable"), or a URI matching all data sources of a
particular type ("table:")''',
type='list'),
Config('timestamp', '"%b %d %H:%M:%S"', r'''
a timestamp prepended to each log record, may contain strftime
conversion specifications, when \c json is configured, defaults
to \c "%FT%Y.000Z"'''),
Config('wait', '0', r'''
seconds to wait between each write of the log records; setting
this value above 0 configures statistics logging''',
min='0', max='100000'),
]
connection_reconfigure_statistics_log_configuration = [
Config('statistics_log', '', r'''
log any statistics the database is configured to maintain,
to a file. See @ref statistics for more information. Enabling
the statistics log server uses a session from the configured
session_max''',
type='category', subconfig=
statistics_log_configuration_common)
]
wiredtiger_open_statistics_log_configuration = [
Config('statistics_log', '', r'''
log any statistics the database is configured to maintain,
to a file. See @ref statistics for more information. Enabling
the statistics log server uses a session from the configured
session_max''',
type='category', subconfig=
statistics_log_configuration_common + [
Config('path', '"."', r'''
the name of a directory into which statistics files are written.
The directory must already exist. If the value is not an absolute
path, the path is relative to the database home (see @ref
absolute_path for more information)''')
])
]
session_config = [
Config('cache_cursors', 'true', r'''
enable caching of cursors for reuse. Any calls to WT_CURSOR::close
for a cursor created in this session will mark the cursor
as cached and keep it available to be reused for later calls
to WT_SESSION::open_cursor. Cached cursors may be eventually
closed. This value is inherited from ::wiredtiger_open
\c cache_cursors''',
type='boolean'),
Config('ignore_cache_size', 'false', r'''
when set, operations performed by this session ignore the cache size
and are not blocked when the cache is full. Note that use of this
option for operations that create cache pressure can starve ordinary
sessions that obey the cache size.''',
type='boolean'),
Config('isolation', 'read-committed', r'''
the default isolation level for operations in this session''',
choices=['read-uncommitted', 'read-committed', 'snapshot']),
]
wiredtiger_open_common =\
connection_runtime_config +\
wiredtiger_open_compatibility_configuration +\
wiredtiger_open_log_configuration +\
wiredtiger_open_statistics_log_configuration + [
Config('buffer_alignment', '-1', r'''
in-memory alignment (in bytes) for buffers used for I/O. The
default value of -1 indicates a platform-specific alignment value
should be used (4KB on Linux systems when direct I/O is configured,
zero elsewhere)''',
min='-1', max='1MB'),
Config('builtin_extension_config', '', r'''
A structure where the keys are the names of builtin extensions and the
values are passed to WT_CONNECTION::load_extension as the \c config
parameter (for example,
<code>builtin_extension_config={zlib={compression_level=3}}</code>)'''),
Config('cache_cursors', 'true', r'''
enable caching of cursors for reuse. This is the default value
for any sessions created, and can be overridden in configuring
\c cache_cursors in WT_CONNECTION.open_session.''',
type='boolean'),
Config('checkpoint_sync', 'true', r'''
flush files to stable storage when closing or writing
checkpoints''',
type='boolean'),
Config('direct_io', '', r'''
Use \c O_DIRECT on POSIX systems, and \c FILE_FLAG_NO_BUFFERING on
Windows to access files. Options are given as a list, such as
<code>"direct_io=[data]"</code>. Configuring \c direct_io requires
care, see @ref tuning_system_buffer_cache_direct_io for important
warnings. Including \c "data" will cause WiredTiger data files to use
direct I/O, including \c "log" will cause WiredTiger log files to use
direct I/O, and including \c "checkpoint" will cause WiredTiger data
files opened at a checkpoint (i.e: read-only) to use direct I/O.
\c direct_io should be combined with \c write_through to get the
equivalent of \c O_DIRECT on Windows''',
type='list', choices=['checkpoint', 'data', 'log']),
Config('encryption', '', r'''
configure an encryptor for system wide metadata and logs.
If a system wide encryptor is set, it is also used for
encrypting data files and tables, unless encryption configuration
is explicitly set for them when they are created with
WT_SESSION::create''',
type='category', subconfig=[
Config('name', 'none', r'''
Permitted values are \c "none"
or custom encryption engine name created with
WT_CONNECTION::add_encryptor.
See @ref encryption for more information'''),
Config('keyid', '', r'''
An identifier that identifies a unique instance of the encryptor.
It is stored in clear text, and thus is available when
the wiredtiger database is reopened. On the first use
of a (name, keyid) combination, the WT_ENCRYPTOR::customize
function is called with the keyid as an argument'''),
Config('secretkey', '', r'''
A string that is passed to the WT_ENCRYPTOR::customize function.
It is never stored in clear text, so must be given to any
subsequent ::wiredtiger_open calls to reopen the database.
It must also be provided to any "wt" commands used with
this database'''),
]),
Config('extensions', '', r'''
list of shared library extensions to load (using dlopen).
Any values specified to a library extension are passed to
WT_CONNECTION::load_extension as the \c config parameter
(for example,
<code>extensions=(/path/ext.so={entry=my_entry})</code>)''',
type='list'),
Config('file_extend', '', r'''
file extension configuration. If set, extend files of the set
type in allocations of the set size, instead of a block at a
time as each new block is written. For example,
<code>file_extend=(data=16MB)</code>. If set to 0, disable the file
extension for the set type. For log files, the allowed range is
between 100KB and 2GB; values larger than the configured maximum log
size and the default config would extend log files in allocations of
the maximum log file size.''',
type='list', choices=['data', 'log']),
Config('hazard_max', '1000', r'''
maximum number of simultaneous hazard pointers per session
handle''',
min=15, undoc=True),
Config('mmap', 'true', r'''
Use memory mapping to access files when possible''',
type='boolean'),
Config('multiprocess', 'false', r'''
permit sharing between processes (will automatically start an
RPC server for primary processes and use RPC for secondary
processes). <b>Not yet supported in WiredTiger</b>''',
type='boolean'),
Config('readonly', 'false', r'''
open connection in read-only mode. The database must exist. All
methods that may modify a database are disabled. See @ref readonly
for more information''',
type='boolean'),
Config('salvage', 'false', r'''
open connection and salvage any WiredTiger-owned database and log
files that it detects as corrupted. This API should only be used
after getting an error return of WT_TRY_SALVAGE.
Salvage rebuilds files in place, overwriting existing files.
We recommend making a backup copy of all files with the
WiredTiger prefix prior to passing this flag.''',
type='boolean'),
Config('session_max', '100', r'''
maximum expected number of sessions (including server
threads)''',
min='1'),
Config('session_scratch_max', '2MB', r'''
maximum memory to cache in each session''',
type='int', undoc=True),
Config('session_table_cache', 'true', r'''
Maintain a per-session cache of tables''',
type='boolean', undoc=True), # Obsolete after WT-3476
Config('transaction_sync', '', r'''
how to sync log records when the transaction commits''',
type='category', subconfig=[
Config('enabled', 'false', r'''
whether to sync the log on every commit by default, can be
overridden by the \c sync setting to
WT_SESSION::commit_transaction''',
type='boolean'),
Config('method', 'fsync', r'''
the method used to ensure log records are stable on disk, see
@ref tune_durability for more information''',
choices=['dsync', 'fsync', 'none']),
]),
Config('write_through', '', r'''
Use \c FILE_FLAG_WRITE_THROUGH on Windows to write to files. Ignored
on non-Windows systems. Options are given as a list, such as
<code>"write_through=[data]"</code>. Configuring \c write_through
requires care, see @ref tuning_system_buffer_cache_direct_io for
important warnings. Including \c "data" will cause WiredTiger data
files to write through cache, including \c "log" will cause WiredTiger
log files to write through cache. \c write_through should be combined
with \c direct_io to get the equivalent of POSIX \c O_DIRECT on
Windows''',