-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Config.java
2101 lines (1809 loc) · 69.1 KB
/
Config.java
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
// Copyright 2021-present StarRocks, Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This file is based on code available under the Apache license here:
// https://github.com/apache/incubator-doris/blob/master/fe/fe-core/src/main/java/org/apache/doris/common/Config.java
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.starrocks.common;
import com.starrocks.StarRocksFE;
public class Config extends ConfigBase {
/**
* The max size of one sys log and audit log
*/
@ConfField
public static int log_roll_size_mb = 1024; // 1 GB
/**
* sys_log_dir:
* This specifies FE log dir. FE will produces 2 log files:
* fe.log: all logs of FE process.
* fe.warn.log all WARNING and ERROR log of FE process.
* <p>
* sys_log_level:
* INFO, WARNING, ERROR, FATAL
* <p>
* sys_log_roll_num:
* Maximal FE log files to be kept within an sys_log_roll_interval.
* default is 10, which means there will be at most 10 log files in a day
* <p>
* sys_log_verbose_modules:
* Verbose modules. VERBOSE level is implemented by log4j DEBUG level.
* eg:
* sys_log_verbose_modules = com.starrocks.globalStateMgr
* This will only print debug log of files in package com.starrocks.globalStateMgr and all its sub packages.
* <p>
* sys_log_roll_interval:
* DAY: log suffix is yyyyMMdd
* HOUR: log suffix is yyyyMMddHH
* <p>
* sys_log_delete_age:
* default is 7 days, if log's last modify time is 7 days ago, it will be deleted.
* support format:
* 7d 7 days
* 10h 10 hours
* 60m 60 mins
* 120s 120 seconds
*/
@ConfField
public static String sys_log_dir = StarRocksFE.STARROCKS_HOME_DIR + "/log";
@ConfField
public static String sys_log_level = "INFO";
@ConfField
public static int sys_log_roll_num = 10;
@ConfField
public static String[] sys_log_verbose_modules = {};
@ConfField
public static String sys_log_roll_interval = "DAY";
@ConfField
public static String sys_log_delete_age = "7d";
@Deprecated
@ConfField
public static String sys_log_roll_mode = "SIZE-MB-1024";
/**
* audit_log_dir:
* This specifies FE audit log dir.
* Audit log fe.audit.log contains all requests with related infos such as user, host, cost, status, etc.
* <p>
* audit_log_roll_num:
* Maximal FE audit log files to be kept within an audit_log_roll_interval.
* <p>
* audit_log_modules:
* Slow query contains all queries which cost exceed *qe_slow_log_ms*
* <p>
* qe_slow_log_ms:
* If the response time of a query exceed this threshold, it will be recored in audit log as slow_query.
* <p>
* audit_log_roll_interval:
* DAY: log suffix is yyyyMMdd
* HOUR: log suffix is yyyyMMddHH
* <p>
* audit_log_delete_age:
* default is 30 days, if log's last modify time is 30 days ago, it will be deleted.
* support format:
* 7d 7 days
* 10h 10 hours
* 60m 60 mins
* 120s 120 seconds
*/
@ConfField
public static String audit_log_dir = StarRocksFE.STARROCKS_HOME_DIR + "/log";
@ConfField
public static int audit_log_roll_num = 90;
@ConfField
public static String[] audit_log_modules = {"slow_query", "query"};
@ConfField(mutable = true)
public static long qe_slow_log_ms = 5000;
@ConfField
public static String audit_log_roll_interval = "DAY";
@ConfField
public static String audit_log_delete_age = "30d";
@ConfField(mutable = true)
public static long slow_lock_threshold_ms = 3000L;
@ConfField(mutable = true)
public static long slow_lock_log_every_ms = 3000L;
/**
* dump_log_dir:
* This specifies FE dump log dir.
* Dump log fe.dump.log contains all dump information which query has Exception
* <p>
* dump_log_roll_num:
* Maximal FE log files to be kept within an dump_log_roll_interval.
* <p>
* dump_log_modules:
* Dump information for an abnormal query.
* <p>
* dump_log_roll_interval:
* DAY: log suffix is yyyyMMdd
* HOUR: log suffix is yyyyMMddHH
* <p>
* dump_log_delete_age:
* default is 7 days, if log's last modify time is 7 days ago, it will be deleted.
* support format:
* 7d 7 days
* 10h 10 hours
* 60m 60 mins
* 120s 120 seconds
*/
@ConfField
public static String dump_log_dir = StarRocksFE.STARROCKS_HOME_DIR + "/log";
@ConfField
public static int dump_log_roll_num = 10;
@ConfField
public static String[] dump_log_modules = {"query"};
@ConfField
public static String dump_log_roll_interval = "DAY";
@ConfField
public static String dump_log_delete_age = "7d";
/**
* big_query_log_dir:
* This specifies FE big query log dir.
* Dump log fe.big_query.log contains all information about big query.
* The structure of each log record is very similar to the audit log.
* If the cpu cost of a query exceeds big_query_log_cpu_second_threshold,
* or scan rows exceeds big_query_log_scan_rows_threshold,
* or scan bytes exceeds big_query_log_scan_bytes_threshold,
* we will consider it as a big query.
* These thresholds are defined by the user.
* <p>
* big_query_log_roll_num:
* Maximal FE log files to be kept within an big_query_log_roll_interval.
* <p>
* big_query_log_modules:
* Informations for all big queries.
* <p>
* big_query_log_roll_interval:
* DAY: log suffix is yyyyMMdd
* HOUR: log suffix is yyyyMMddHH
* <p>
* big_query_log_delete_age:
* default is 7 days, if log's last modify time is 7 days ago, it will be deleted.
* support format:
* 7d 7 days
* 10h 10 hours
* 60m 60 mins
* 120s 120 seconds
*/
@ConfField
public static String big_query_log_dir = StarRocksFE.STARROCKS_HOME_DIR + "/log";
@ConfField
public static int big_query_log_roll_num = 10;
@ConfField
public static String[] big_query_log_modules = {"query"};
@ConfField
public static String big_query_log_roll_interval = "DAY";
@ConfField
public static String big_query_log_delete_age = "7d";
/**
* Used to limit the maximum number of partitions that can be created when creating a dynamic partition table,
* to avoid creating too many partitions at one time.
*/
@ConfField(mutable = true) public static int max_dynamic_partition_num = 500;
/**
* plugin_dir:
* plugin install directory
*/
@ConfField
public static String plugin_dir = System.getenv("STARROCKS_HOME") + "/plugins";
@ConfField(mutable = true)
public static boolean plugin_enable = true;
/**
* Labels of finished or cancelled load jobs will be removed
* 1. after *label_keep_max_second*
* or
* 2. jobs total num > *label_keep_max_num*
* The removed labels can be reused.
* Set a short time will lower the FE memory usage.
* (Because all load jobs' info is kept in memory before being removed)
*/
@ConfField(mutable = true)
public static int label_keep_max_second = 3 * 24 * 3600; // 3 days
/**
* for load job managed by LoadManager, such as Insert, Broker load and Spark load.
*/
@ConfField(mutable = true)
public static int label_keep_max_num = 1000;
/**
* Load label cleaner will run every *label_clean_interval_second* to clean the outdated jobs.
*/
@ConfField
public static int label_clean_interval_second = 4 * 3600; // 4 hours
/**
* For Task framework do some background operation like cleanup Task/TaskRun.
* It will run every *task_check_interval_second* to do background job.
*/
@ConfField
public static int task_check_interval_second = 4 * 3600; // 4 hours
/**
* for task set expire time
*/
@ConfField(mutable = true)
public static int task_ttl_second = 3 * 24 * 3600; // 3 day
/**
* for task run set expire time
*/
@ConfField(mutable = true)
public static int task_runs_ttl_second = 3 * 24 * 3600; // 3 day
/**
* The max keep time of some kind of jobs.
* like schema change job and rollup job.
*/
@ConfField(mutable = true)
public static int history_job_keep_max_second = 7 * 24 * 3600; // 7 days
/**
* the transaction will be cleaned after transaction_clean_interval_second seconds if the transaction is visible or aborted
* we should make this interval as short as possible and each clean cycle as soon as possible
*/
@ConfField
public static int transaction_clean_interval_second = 30;
// Configurations for meta data durability
/**
* StarRocks meta data will be saved here.
* The storage of this dir is highly recommended as to be:
* 1. High write performance (SSD)
* 2. Safe (RAID)
*/
@ConfField
public static String meta_dir = StarRocksFE.STARROCKS_HOME_DIR + "/meta";
/**
* temp dir is used to save intermediate results of some process, such as backup and restore process.
* file in this dir will be cleaned after these process is finished.
*/
@ConfField
public static String tmp_dir = StarRocksFE.STARROCKS_HOME_DIR + "/temp_dir";
/**
* Edit log type.
* BDB: write log to bdbje
* LOCAL: deprecated.
*/
@ConfField
public static String edit_log_type = "BDB";
/**
* bdbje port
*/
@ConfField
public static int edit_log_port = 9010;
/**
* Leader FE will save image every *edit_log_roll_num* meta journals.
*/
@ConfField(mutable = true)
public static int edit_log_roll_num = 50000;
/**
* whether ignore unknown log id
* when fe rolls back to low version, there may be log id that low version fe can not recognise
* if set to true, fe will ignore those id
* or fe will exit
*/
@ConfField(mutable = true)
public static boolean ignore_unknown_log_id = false;
/**
* hdfs_read_buffer_size_kb for reading hdfs
*/
@ConfField(mutable = true)
public static int hdfs_read_buffer_size_kb = 8192;
/**
* hdfs_write_buffer_size_kb for writing hdfs
*/
@ConfField(mutable = true)
public static int hdfs_write_buffer_size_kb = 1024;
/**
* expire seconds for unused file system manager
*/
@ConfField(mutable = true)
public static int hdfs_file_sytem_expire_seconds = 300;
/**
* Non-master FE will stop offering service
* if meta data delay gap exceeds *meta_delay_toleration_second*
*/
@ConfField(mutable = true)
public static int meta_delay_toleration_second = 300; // 5 min
/**
* Leader FE sync policy of bdbje.
* If you only deploy one Follower FE, set this to 'SYNC'. If you deploy more than 3 Follower FE,
* you can set this and the following 'replica_sync_policy' to WRITE_NO_SYNC.
* more info, see: http://docs.oracle.com/cd/E17277_02/html/java/com/sleepycat/je/Durability.SyncPolicy.html
*/
@ConfField
public static String master_sync_policy = "SYNC"; // SYNC, NO_SYNC, WRITE_NO_SYNC
/**
* Follower FE sync policy of bdbje.
*/
@ConfField
public static String replica_sync_policy = "SYNC"; // SYNC, NO_SYNC, WRITE_NO_SYNC
/**
* Replica ack policy of bdbje.
* more info, see: http://docs.oracle.com/cd/E17277_02/html/java/com/sleepycat/je/Durability.ReplicaAckPolicy.html
*/
@ConfField
public static String replica_ack_policy = "SIMPLE_MAJORITY"; // ALL, NONE, SIMPLE_MAJORITY
/**
* The heartbeat timeout of bdbje between master and follower.
* the default is 30 seconds, which is same as default value in bdbje.
* If the network is experiencing transient problems, of some unexpected long java GC annoying you,
* you can try to increase this value to decrease the chances of false timeouts
*/
@ConfField
public static int bdbje_heartbeat_timeout_second = 30;
/**
* The timeout for bdbje replica ack
*/
@ConfField
public static int bdbje_replica_ack_timeout_second = 10;
/**
* The lock timeout of bdbje operation
* If there are many LockTimeoutException in FE WARN log, you can try to increase this value
*/
@ConfField
public static int bdbje_lock_timeout_second = 1;
/**
* Set the maximum acceptable clock skew between non-leader FE to Leader FE host.
* This value is checked whenever a non-leader FE establishes a connection to leader FE via BDBJE.
* The connection is abandoned if the clock skew is larger than this value.
*/
@ConfField
public static long max_bdbje_clock_delta_ms = 5000; // 5s
/**
* bdb je log level
* If you want to print all levels of logs, set to ALL
*/
@ConfField
public static String bdbje_log_level = "INFO";
/**
* bdb je cleaner thread number
*/
@ConfField
public static int bdbje_cleaner_threads = 1;
/**
* The cost of replaying the replication stream as compared to the cost of
* performing a network restore, represented as a percentage. Specifies
* the relative cost of using a log file as the source of transactions to
* replay on a replica as compared to using the file as part of a network
* restore. This parameter is used to determine whether a cleaned log file
* that could be used to support replay should be removed because a network
* restore would be more efficient. The value is typically larger than
* 100, to represent that replay is usually more expensive than network
* restore for a given amount of log data due to the cost of replaying
* transactions. If the value is 0, then the parameter is disabled, and no
* log files will be retained based on the relative costs of replay and
* network restore.
*
* <p>Note that log files are always retained if they are known to be
* needed to support replication for electable replicas that have been in
* contact with the master within the REP_STREAM_TIMEOUT(default is 30min) period,
* or by any replica currently performing replication. This parameter only
* applies to the retention of additional files that might be useful to
* secondary nodes that are out of contact, or to electable nodes that have
* been out of contact for longer than REP_STREAM_TIMEOUT.</p>
*
* <p>To disable the retention of these additional files, set this
* parameter to zero.</p>
* <p>
* If the bdb dir expands, set this param to 0.
*/
@ConfField
public static int bdbje_replay_cost_percent = 150;
/**
* the max txn number which bdbje can rollback when trying to rejoin the group
*/
@ConfField
public static int txn_rollback_limit = 100;
/**
* num of thread to handle heartbeat events in heartbeat_mgr.
*/
@ConfField
public static int heartbeat_mgr_threads_num = 8;
/**
* blocking queue size to store heartbeat task in heartbeat_mgr.
*/
@ConfField
public static int heartbeat_mgr_blocking_queue_size = 1024;
/**
* max num of thread to handle agent task in agent task thread-pool.
*/
@ConfField
public static int max_agent_task_threads_num = 4096;
/**
* This config will decide whether to resend agent task when create_time for agent_task is set,
* only when current_time - create_time > agent_task_resend_wait_time_ms can ReportHandler do resend agent task
*/
@ConfField(mutable = true)
public static long agent_task_resend_wait_time_ms = 5000;
/**
* If true, FE will reset bdbje replication group(that is, to remove all electable nodes info)
* and is supposed to start as Leader.
* If all the electable nodes can not start, we can copy the meta data
* to another node and set this config to true to try to restart the FE.
*/
@ConfField
public static String metadata_failure_recovery = "false";
/**
* If the bdb data is corrupted, and you want to start the cluster only with image, set this param to true
*/
@ConfField
public static boolean start_with_incomplete_meta = false;
/**
* If true, non-leader FE will ignore the meta data delay gap between Leader FE and its self,
* even if the metadata delay gap exceeds *meta_delay_toleration_second*.
* Non-leader FE will still offer read service.
* <p>
* This is helpful when you try to stop the Leader FE for a relatively long time for some reason,
* but still wish the non-leader FE can offer read service.
*/
@ConfField(mutable = true)
public static boolean ignore_meta_check = false;
/**
* Specified an IP for frontend, instead of the ip get by *InetAddress.getByName*.
* This can be used when *InetAddress.getByName* get an unexpected IP address.
* Default is "0.0.0.0", which means not set.
* CAN NOT set this as a hostname, only IP.
*/
@ConfField
public static String frontend_address = "0.0.0.0";
/**
* Declare a selection strategy for those servers have many ips.
* Note that there should at most one ip match this list.
* this is a list in semicolon-delimited format, in CIDR notation, e.g. 10.10.10.0/24
* If no ip match this rule, will choose one randomly.
*/
@ConfField
public static String priority_networks = "";
/**
* Fe http port
* Currently, all FEs' http port must be same.
*/
@ConfField
public static int http_port = 8030;
/**
* The backlog_num for netty http server
* When you enlarge this backlog_num, you should ensure it's value larger than
* the linux /proc/sys/net/core/somaxconn config
*/
@ConfField
public static int http_backlog_num = 1024;
@ConfField
public static int http_max_initial_line_length = 4096;
@ConfField
public static int http_max_header_size = 8192;
@ConfField
public static int http_max_chunk_size = 8192;
/**
* Cluster name will be shown as the title of web page
*/
@ConfField
public static String cluster_name = "StarRocks Cluster";
/**
* FE thrift server port
*/
@ConfField
public static int rpc_port = 9020;
/**
* The connection timeout and socket timeout config for thrift server
* The value for thrift_client_timeout_ms is set to be larger than zero to prevent
* some hang up problems in java.net.SocketInputStream.socketRead0
*/
@ConfField
public static int thrift_client_timeout_ms = 5000;
/**
* The backlog_num for thrift server
* When you enlarge this backlog_num, you should ensure it's value larger than
* the linux /proc/sys/net/core/somaxconn config
*/
@ConfField
public static int thrift_backlog_num = 1024;
/**
* Define thrift server's server model, default is TThreadPoolServer model
*/
@ConfField
public static String thrift_server_type = ThriftServer.THREAD_POOL;
/**
* the timeout for thrift rpc call
*/
@ConfField(mutable = true)
public static int thrift_rpc_timeout_ms = 10000;
/**
* the retry times for thrift rpc call
*/
@ConfField(mutable = true)
public static int thrift_rpc_retry_times = 3;
// May be necessary to modify the following BRPC configurations in high concurrency scenarios.
// The size of BRPC connection pool. It will limit the concurrency of sending requests, because
// each request must borrow a connection from the pool.
@ConfField
public static int brpc_connection_pool_size = 16;
// BRPC idle wait time (ms)
@ConfField
public static int brpc_idle_wait_max_time = 10000;
/**
* FE mysql server port
*/
@ConfField
public static int query_port = 9030;
/**
* The backlog_num for mysql nio server
* When you enlarge this backlog_num, you should ensure it's value larger than
* the linux /proc/sys/net/core/somaxconn config
*/
@ConfField
public static int mysql_nio_backlog_num = 1024;
/**
* mysql service nio option.
*/
@ConfField
public static boolean mysql_service_nio_enabled = true;
/**
* num of thread to handle io events in mysql.
*/
@ConfField
public static int mysql_service_io_threads_num = 4;
/**
* max num of thread to handle task in mysql.
*/
@ConfField
public static int max_mysql_service_task_threads_num = 4096;
/**
* modifies the version string returned by following situations:
* select version();
* handshake packet version.
* global variable version.
*/
@ConfField
public static String mysql_server_version = "5.1.0";
/**
* node(FE or BE) will be considered belonging to the same StarRocks cluster if they have same cluster id.
* Cluster id is usually a random integer generated when master FE start at first time.
* You can also sepecify one.
*/
@ConfField
public static int cluster_id = -1;
/**
* If a backend is down for *max_backend_down_time_second*, a BACKEND_DOWN event will be triggered.
* Do not set this if you know what you are doing.
*/
@ConfField(mutable = true)
public static int max_backend_down_time_second = 3600; // 1h
/**
* If set to true, the backend will be automatically dropped after finishing decommission.
* If set to false, the backend will not be dropped and remaining in DECOMMISSION state.
*/
@ConfField(mutable = true)
public static boolean drop_backend_after_decommission = true;
// Configurations for load, clone, create table, alter table etc. We will rarely change them
/**
* Maximal waiting time for creating a single replica.
* eg.
* if you create a table with #m tablets and #n replicas for each tablet,
* the create table request will run at most (m * n * tablet_create_timeout_second) before timeout.
*/
@ConfField(mutable = true)
public static int tablet_create_timeout_second = 1;
/**
* minimal intervals between two publish version action
*/
@ConfField
public static int publish_version_interval_ms = 10;
/**
* The thrift server max worker threads
*/
@ConfField(mutable = true)
public static int thrift_server_max_worker_threads = 4096;
/**
* If there is no thread to handle new request, the request will be pend to a queue,
* the pending queue size is thrift_server_queue_size
*/
@ConfField
public static int thrift_server_queue_size = 4096;
/**
* Maximal wait seconds for straggler node in load
* eg.
* there are 3 replicas A, B, C
* load is already quorum finished(A,B) at t1 and C is not finished
* if (current_time - t1) > 300s, then StarRocks will treat C as a failure node
* will call transaction manager to commit the transaction and tell transaction manager
* that C is failed
* <p>
* This is also used when waiting for publish tasks
* <p>
* TODO this parameter is the default value for all job and the DBA could specify it for separate job
*/
@ConfField(mutable = true)
public static int load_straggler_wait_second = 300;
/**
* The load scheduler running interval.
* A load job will transfer its state from PENDING to LOADING to FINISHED.
* The load scheduler will transfer load job from PENDING to LOADING
* while the txn callback will transfer load job from LOADING to FINISHED.
* So a load job will cost at most one interval to finish when the concurrency has not reached the upper limit.
*/
@ConfField
public static int load_checker_interval_second = 5;
/**
* Default broker load timeout
*/
@ConfField(mutable = true)
public static int broker_load_default_timeout_second = 14400; // 4 hour
/**
* Maximal bytes that a single broker scanner will read.
* Do not set this if you know what you are doing.
*/
@ConfField(mutable = true)
public static long min_bytes_per_broker_scanner = 67108864L; // 64MB
/**
* Maximal concurrency of broker scanners.
* Do not set this if you know what you are doing.
*/
@ConfField(mutable = true)
public static int max_broker_concurrency = 100;
/**
* Default insert load timeout
*/
@ConfField(mutable = true)
public static int insert_load_default_timeout_second = 3600; // 1 hour
/**
* Default stream load and streaming mini load timeout
*/
@ConfField(mutable = true)
public static int stream_load_default_timeout_second = 600; // 600s
/**
* Max stream load and streaming mini load timeout
*/
@ConfField(mutable = true)
public static int max_stream_load_timeout_second = 259200; // 3days
/**
* Max stream load load batch size
*/
@ConfField(mutable = true)
public static int max_stream_load_batch_size_mb = 100;
/**
* Default prepared transaction timeout
*/
@ConfField(mutable = true)
public static int prepared_transaction_default_timeout_second = 86400; // 1day
/**
* Max load timeout applicable to all type of load except for stream load
*/
@ConfField(mutable = true)
public static int max_load_timeout_second = 259200; // 3days
/**
* Min stream load timeout applicable to all type of load
*/
@ConfField(mutable = true)
public static int min_load_timeout_second = 1; // 1s
// Configurations for spark load
/**
* Default spark dpp version
*/
@ConfField
public static String spark_dpp_version = "1.0.0";
/**
* Default spark load timeout
*/
@ConfField(mutable = true)
public static int spark_load_default_timeout_second = 86400; // 1 day
/**
* Default spark home dir
*/
@ConfField
public static String spark_home_default_dir = StarRocksFE.STARROCKS_HOME_DIR + "/lib/spark2x";
/**
* Default spark dependencies path
*/
@ConfField
public static String spark_resource_path = "";
/**
* The specified spark launcher log dir
*/
@ConfField
public static String spark_launcher_log_dir = sys_log_dir + "/spark_launcher_log";
/**
* Default yarn client path
*/
@ConfField
public static String yarn_client_path = StarRocksFE.STARROCKS_HOME_DIR + "/lib/yarn-client/hadoop/bin/yarn";
/**
* Default yarn config file directory
* Each time before running the yarn command, we need to check that the
* config file exists under this path, and if not, create them.
*/
@ConfField
public static String yarn_config_dir = StarRocksFE.STARROCKS_HOME_DIR + "/lib/yarn-config";
/**
* Default number of waiting jobs for routine load and version 2 of load
* This is a desired number.
* In some situation, such as switch the master, the current number is maybe more than desired_max_waiting_jobs
*/
@ConfField(mutable = true)
public static int desired_max_waiting_jobs = 100;
/**
* maximun concurrent running txn num including prepare, commit txns under a single db
* txn manager will reject coming txns
*/
@ConfField(mutable = true)
public static int max_running_txn_num_per_db = 100;
/**
* The load task executor pool size. This pool size limits the max running load tasks.
* Currently, it only limits the load task of broker load, pending and loading phases.
* It should be less than 'max_running_txn_num_per_db'
*/
@ConfField
public static int async_load_task_pool_size = 10;
/**
* Same meaning as *tablet_create_timeout_second*, but used when delete a tablet.
*/
@ConfField(mutable = true)
public static int tablet_delete_timeout_second = 2;
/**
* The high water of disk capacity used percent.
* This is used for calculating load score of a backend.
*/
@ConfField(mutable = true)
public static double capacity_used_percent_high_water = 0.75;
/**
* Maximal timeout of ALTER TABLE request. Set long enough to fit your table data size.
*/
@ConfField(mutable = true)
public static int alter_table_timeout_second = 86400; // 1day
/**
* The alter handler max worker threads
*/
@ConfField
public static int alter_max_worker_threads = 4;
/**
* The alter handler max queue size for worker threads
*/
@ConfField
public static int alter_max_worker_queue_size = 4096;
/**
* If set to true, FE will check backend available capacity by storage medium when create table
* <p>
* The default value should better set to true because if user
* has a deployment with only SSD or HDD medium storage paths,
* create an incompatible table with cause balance problem(SSD tablet cannot move to HDD path, vice versa).
* But currently for compatible reason, we keep it to false.
*/
@ConfField(mutable = true)
public static boolean enable_strict_storage_medium_check = false;
/**
* After dropping database(table/partition), you can recover it by using RECOVER stmt.
* And this specifies the maximal data retention time. After time, the data will be deleted permanently.
*/
@ConfField(mutable = true)
public static long catalog_trash_expire_second = 86400L; // 1day
/**
* Parallel load fragment instance num in single host
*/
@ConfField(mutable = true)
public static int load_parallel_instance_num = 1;
/**
* Export checker's running interval.
*/
@ConfField
public static int export_checker_interval_second = 5;
/**
* Limitation of the concurrency of running export jobs.
* Default is 5.
* 0 is unlimited
*/
@ConfField(mutable = true)
public static int export_running_job_num_limit = 5;
/**
* Limitation of the pending TaskRun queue length.
* Default is 500.
*/
@ConfField(mutable = true)
public static int task_runs_queue_length = 500;
/**
* Limitation of the running TaskRun.
* Default is 20.
*/
@ConfField(mutable = true)
public static int task_runs_concurrency = 20;
/**
* Default timeout of export jobs.
*/
@ConfField(mutable = true)
public static int export_task_default_timeout_second = 2 * 3600; // 2h
/**
* Max bytes of data exported by each export task on each BE.
* Used to split the export job for parallel processing.
* Calculated according to the size of compressed data, default is 256M.
*/
@ConfField(mutable = true)
public static long export_max_bytes_per_be_per_task = 268435456; // 256M
/**
* Size of export task thread pool, default is 5.
*/
@ConfField
public static int export_task_pool_size = 5;
// Configurations for consistency check
/**
* Consistency checker will run from *consistency_check_start_time* to *consistency_check_end_time*.
* Default is from 23:00 to 04:00
*/
@ConfField
public static String consistency_check_start_time = "23";
@ConfField
public static String consistency_check_end_time = "4";
/**
* Default timeout of a single consistency check task. Set long enough to fit your tablet size.
*/
@ConfField(mutable = true)
public static long check_consistency_default_timeout_second = 600; // 10 min
// Configurations for query engine
/**
* Maximal number of connections per FE.
*/
@ConfField
public static int qe_max_connection = 1024;
/**
* Maximal number of thread in connection-scheduler-pool.
*/
@ConfField
public static int max_connection_scheduler_threads_num = 4096;
/**
* Used to limit element num of InPredicate in delete statement.
*/
@ConfField(mutable = true)
public static int max_allowed_in_element_num_of_delete = 10000;
/**
* control materialized view
*/
@ConfField(mutable = true)
public static boolean enable_materialized_view = true;
@ConfField(mutable = true)
public static boolean enable_udf = false;
@ConfField(mutable = true)
public static boolean enable_decimal_v3 = true;
@ConfField(mutable = true)
public static boolean enable_sql_blacklist = false;
/**
* If set to true, dynamic partition feature will open