-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
granter
903 lines (778 loc) · 39 KB
/
granter
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
init-grant-coordinator min-cpu=1 max-cpu=3 sql-kv-tokens=2 sql-sql-tokens=1 sql-leaf=2 sql-root=1
----
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
try-get work=kv
----
kv: tryGet(1) returned true
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 1, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
# No more slots.
try-get work=kv
----
kv: tryGet(1) returned false
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 1, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
set-has-waiting-requests work=kv v=true
----
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 1, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
# Since no more KV slots, couldn't get.
try-get work=sql-kv-response
----
sql-kv-response: tryGet(1) returned false
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 1, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
set-has-waiting-requests work=sql-kv-response v=true
----
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 1, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
# Since no more KV slots, couldn't get.
try-get work=sql-leaf-start
----
sql-leaf-start: tryGet(1) returned false
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 1, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
set-has-waiting-requests work=sql-leaf-start v=true
----
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 1, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
# Since no more KV slots, couldn't get.
try-get work=sql-root-start
----
sql-root-start: tryGet(1) returned false
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 1, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
set-has-waiting-requests work=sql-root-start v=true
----
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 1, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
return-grant work=kv
----
kv: returnGrant(1)
kv: granted in chain 1, and returning 1
GrantCoordinator:
(chain: id: 1 active: true index: 0) kv: used: 1, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
set-has-waiting-requests work=kv v=false
----
GrantCoordinator:
(chain: id: 1 active: true index: 0) kv: used: 1, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
set-return-value-from-granted work=kv v=0
----
GrantCoordinator:
(chain: id: 1 active: true index: 0) kv: used: 1, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
# The grant chain dies out since kv slots are fully used.
continue-grant-chain work=kv
----
kv: continueGrantChain
GrantCoordinator:
(chain: id: 2 active: false index: 1) kv: used: 1, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
# Grant to sql-kv-response consumes a token.
return-grant work=kv
----
kv: returnGrant(1)
sql-kv-response: granted in chain 2, and returning 1
GrantCoordinator:
(chain: id: 2 active: true index: 1) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 1
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
# Grant to sql-kv-response consumes another token. None left.
continue-grant-chain work=sql-kv-response
----
sql-kv-response: continueGrantChain
sql-kv-response: granted in chain 2, and returning 1
GrantCoordinator:
(chain: id: 2 active: true index: 1) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 0
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
# Even though there are still waiting requests for sql-kv-response, no more
# tokens, so the grant chain can continue past it.
continue-grant-chain work=sql-kv-response
----
sql-kv-response: continueGrantChain
sql-leaf-start: granted in chain 2, and returning 1
GrantCoordinator:
(chain: id: 2 active: true index: 3) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 0
sql-sql-response: avail: 1 sql-leaf-start: used: 1, total: 2 sql-root-start: used: 0, total: 1
continue-grant-chain work=sql-leaf-start
----
sql-leaf-start: continueGrantChain
sql-leaf-start: granted in chain 2, and returning 1
GrantCoordinator:
(chain: id: 2 active: true index: 3) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 0
sql-sql-response: avail: 1 sql-leaf-start: used: 2, total: 2 sql-root-start: used: 0, total: 1
# Even though there are still waiting requests for sql-leaf-start, no more
# tokens, so the grant chain can continue past it.
continue-grant-chain work=sql-leaf-start
----
sql-leaf-start: continueGrantChain
sql-root-start: granted in chain 2, and returning 1
GrantCoordinator:
(chain: id: 2 active: true index: 4) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 0
sql-sql-response: avail: 1 sql-leaf-start: used: 2, total: 2 sql-root-start: used: 1, total: 1
# sql-root-start ran out of tokens. Grant chain dies out.
continue-grant-chain work=sql-root-start
----
sql-root-start: continueGrantChain
GrantCoordinator:
(chain: id: 3 active: false index: 5) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 0
sql-sql-response: avail: 1 sql-leaf-start: used: 2, total: 2 sql-root-start: used: 1, total: 1
# Return sql-leaf-start slot. This will cause another grant chain to start
# which will eventually find a free slot to give to sql-leaf-start.
return-grant work=sql-leaf-start
----
sql-leaf-start: returnGrant(1)
sql-leaf-start: granted in chain 3, and returning 1
GrantCoordinator:
(chain: id: 3 active: true index: 3) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 0
sql-sql-response: avail: 1 sql-leaf-start: used: 2, total: 2 sql-root-start: used: 1, total: 1
# Return another sql-leaf-start slot. The grant chain is already active and
# not past this WorkKind, so no grant is done.
return-grant work=sql-leaf-start
----
sql-leaf-start: returnGrant(1)
GrantCoordinator:
(chain: id: 3 active: true index: 3) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 0
sql-sql-response: avail: 1 sql-leaf-start: used: 1, total: 2 sql-root-start: used: 1, total: 1
# The kv slots are fully used after this tryGet, which succeeds.
try-get work=kv
----
kv: tryGet(1) returned true
GrantCoordinator:
(chain: id: 3 active: true index: 3) kv: used: 1, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 0
sql-sql-response: avail: 1 sql-leaf-start: used: 1, total: 2 sql-root-start: used: 1, total: 1
# This tryGet for kv fails and forces termination of the grant chain.
try-get work=kv
----
kv: tryGet(1) returned false
GrantCoordinator:
(chain: id: 4 active: false index: 3) kv: used: 1, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 0
sql-sql-response: avail: 1 sql-leaf-start: used: 1, total: 2 sql-root-start: used: 1, total: 1
set-has-waiting-requests work=kv v=true
----
GrantCoordinator:
(chain: id: 4 active: false index: 3) kv: used: 1, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 0
sql-sql-response: avail: 1 sql-leaf-start: used: 1, total: 2 sql-root-start: used: 1, total: 1
# The grant chain cannot continue since it was force terminated, and a new one
# is not able to restart since there are no free kv slots.
continue-grant-chain work=sql-leaf-start
----
sql-leaf-start: continueGrantChain
GrantCoordinator:
(chain: id: 4 active: false index: 3) kv: used: 1, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 0
sql-sql-response: avail: 1 sql-leaf-start: used: 1, total: 2 sql-root-start: used: 1, total: 1
# Pretend that the kv work that was waiting is gone.
set-has-waiting-requests work=kv v=false
----
GrantCoordinator:
(chain: id: 4 active: false index: 3) kv: used: 1, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 0
sql-sql-response: avail: 1 sql-leaf-start: used: 1, total: 2 sql-root-start: used: 1, total: 1
# Some other kv work takes without permission.
took-without-permission work=kv
----
kv: tookWithoutPermission(1)
GrantCoordinator:
(chain: id: 4 active: false index: 3) kv: used: 2, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 0
sql-sql-response: avail: 1 sql-leaf-start: used: 1, total: 2 sql-root-start: used: 1, total: 1
# Refill the tokens and increase the kv slots to 2.
cpu-load runnable=0 procs=1
----
GrantCoordinator:
(chain: id: 4 active: false index: 1) kv: used: 2, high(moderate)-total: 2(0) moderate-clamp: 0 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 1, total: 2 sql-root-start: used: 1, total: 1
# Tokens don't get overfull. And kv slots increased to 3. This causes a grant
# to sql-kv-response and the grant chain is again active.
cpu-load runnable=0 procs=1
----
sql-kv-response: granted in chain 4, and returning 1
GrantCoordinator:
(chain: id: 4 active: true index: 1) kv: used: 2, high(moderate)-total: 3(0) moderate-clamp: 0 sql-kv-response: avail: 1
sql-sql-response: avail: 1 sql-leaf-start: used: 1, total: 2 sql-root-start: used: 1, total: 1
# Overload and kv slots decreased. Forces termination of grant chain 4.
cpu-load runnable=2 procs=1
----
GrantCoordinator:
(chain: id: 5 active: false index: 1) kv: used: 2, high(moderate)-total: 2(0) moderate-clamp: -1 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 1, total: 2 sql-root-start: used: 1, total: 1
# Grant chain 4 terminates.
continue-grant-chain work=sql-kv-response
----
sql-kv-response: continueGrantChain
GrantCoordinator:
(chain: id: 5 active: false index: 1) kv: used: 2, high(moderate)-total: 2(0) moderate-clamp: -1 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 1, total: 2 sql-root-start: used: 1, total: 1
# Return a slot for sql-leaf-start. Grant chain cannot start since KV slots
# are full.
return-grant work=sql-leaf-start
----
sql-leaf-start: returnGrant(1)
GrantCoordinator:
(chain: id: 5 active: false index: 1) kv: used: 2, high(moderate)-total: 2(0) moderate-clamp: -1 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 1, total: 1
# Underload and kv slots increased. The number of procs=4, so can grant 4 at
# the same time. The first 3 get a chain-id=0, i.e., they are not really
# relevant to continuing the grant chain.
cpu-load runnable=2 procs=4
----
sql-kv-response: granted in chain 0, and returning 1
sql-kv-response: granted in chain 0, and returning 1
sql-leaf-start: granted in chain 0, and returning 1
sql-leaf-start: granted in chain 5, and returning 1
GrantCoordinator:
(chain: id: 5 active: true index: 3) kv: used: 2, high(moderate)-total: 3(0) moderate-clamp: 0 sql-kv-response: avail: 0
sql-sql-response: avail: 1 sql-leaf-start: used: 2, total: 2 sql-root-start: used: 1, total: 1
# There is now a free sql-root-start slot, which the grant chain will get to.
return-grant work=sql-root-start
----
sql-root-start: returnGrant(1)
GrantCoordinator:
(chain: id: 5 active: true index: 3) kv: used: 2, high(moderate)-total: 3(0) moderate-clamp: 0 sql-kv-response: avail: 0
sql-sql-response: avail: 1 sql-leaf-start: used: 2, total: 2 sql-root-start: used: 0, total: 1
# Continuing with chain-id=0 has no effect.
continue-grant-chain work=sql-kv-response
----
sql-kv-response: continueGrantChain
GrantCoordinator:
(chain: id: 5 active: true index: 3) kv: used: 2, high(moderate)-total: 3(0) moderate-clamp: 0 sql-kv-response: avail: 0
sql-sql-response: avail: 1 sql-leaf-start: used: 2, total: 2 sql-root-start: used: 0, total: 1
# Continuing chain-id=5 causes a grant to sql-root-start and the chain dies
# out, since do not have a batch of 4 to grant to.
continue-grant-chain work=sql-leaf-start
----
sql-leaf-start: continueGrantChain
sql-root-start: granted in chain 0, and returning 1
GrantCoordinator:
(chain: id: 6 active: false index: 5) kv: used: 2, high(moderate)-total: 3(0) moderate-clamp: 0 sql-kv-response: avail: 0
sql-sql-response: avail: 1 sql-leaf-start: used: 2, total: 2 sql-root-start: used: 1, total: 1
#####################################################################
# Test skipping of enforcements when CPULoad has high sampling period.
init-grant-coordinator min-cpu=1 max-cpu=3 sql-kv-tokens=1 sql-sql-tokens=1 sql-leaf=2 sql-root=2
----
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 1
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 2
# No more slots after this slot is granted.
try-get work=kv
----
kv: tryGet(1) returned true
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 1, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 1
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 2
# Since no more KV slots, cannot grant token to sql-kv-response.
try-get work=sql-kv-response
----
sql-kv-response: tryGet(1) returned false
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 1, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 1
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 2
# Since no more KV slots, cannot grant token to sql-sql-response.
try-get work=sql-sql-response
----
sql-sql-response: tryGet(1) returned false
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 1, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 1
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 2
# CPULoad shows overload, so cannot increase KV slots, but since it is
# infrequent, slot and token enforcement is disabled.
cpu-load runnable=20 procs=1 infrequent=true
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 1, high(moderate)-total: 1(0) moderate-clamp: -19 sql-kv-response: avail: 1
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 2
# sql-kv-response can get a token.
try-get work=sql-kv-response
----
sql-kv-response: tryGet(1) returned true
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 1, high(moderate)-total: 1(0) moderate-clamp: -19 sql-kv-response: avail: 0
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 2
# sql-kv-response can get another token, even though tokens are exhausted.
try-get work=sql-kv-response
----
sql-kv-response: tryGet(1) returned true
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 1, high(moderate)-total: 1(0) moderate-clamp: -19 sql-kv-response: avail: -1
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 2
# sql-sql-response can get a token.
try-get work=sql-sql-response
----
sql-sql-response: tryGet(1) returned true
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 1, high(moderate)-total: 1(0) moderate-clamp: -19 sql-kv-response: avail: -1
sql-sql-response: avail: 0 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 2
# sql-sql-response can get another token, even though tokens are exhausted.
try-get work=sql-sql-response
----
sql-sql-response: tryGet(1) returned true
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 1, high(moderate)-total: 1(0) moderate-clamp: -19 sql-kv-response: avail: -1
sql-sql-response: avail: -1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 2
# KV can get another slot even though slots are exhausted.
try-get work=kv
----
kv: tryGet(1) returned true
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 2, high(moderate)-total: 1(0) moderate-clamp: -19 sql-kv-response: avail: -1
sql-sql-response: avail: -1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 2
#####################################################################
# Test store grant coordinator.
init-store-grant-coordinator
----
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: 153722867280912930, elastic-disk-bw-tokens-avail: 153722867280912930
# Initial tokens are effectively unlimited.
try-get work=kv v=10000
----
kv-regular: tryGet(10000) returned true
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: 153722867280902930, elastic-disk-bw-tokens-avail: 153722867280912930
# Set the io tokens to a smaller value.
set-io-tokens tokens=500
----
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: 500, elastic-disk-bw-tokens-avail: 153722867280912930
# Subtract 100 tokens for elastic work. Note that elastic-disk-bw-tokens-avail also decreases by 100.
took-without-permission work=kv-elastic v=100
----
kv-elastic: tookWithoutPermission(100)
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: 400, elastic-disk-bw-tokens-avail: 153722867280912830
# Add 200 tokens.
return-grant work=kv v=200
----
kv-regular: returnGrant(200)
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: 600, elastic-disk-bw-tokens-avail: 153722867280912830
# Setup waiting requests that want 400 tokens each.
set-has-waiting-requests work=kv v=true
----
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: 600, elastic-disk-bw-tokens-avail: 153722867280912830
set-return-value-from-granted work=kv v=400
----
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: 600, elastic-disk-bw-tokens-avail: 153722867280912830
# Returning tokens triggers granting and 2 requests will be granted until the
# tokens become <= 0.
return-grant work=kv v=100
----
kv-regular: returnGrant(100)
kv-regular: granted in chain 0, and returning 400
kv-regular: granted in chain 0, and returning 400
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: -100, elastic-disk-bw-tokens-avail: 153722867280912830
set-return-value-from-granted work=kv v=100
----
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: -100, elastic-disk-bw-tokens-avail: 153722867280912830
# No tokens to give.
try-get work=kv
----
kv-regular: tryGet(1) returned false
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: -100, elastic-disk-bw-tokens-avail: 153722867280912830
# Increment by 50 tokens.
set-io-tokens tokens=50
----
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: -50, elastic-disk-bw-tokens-avail: 153722867280912830
# Return another 50 tokens. Since the number of tokens is 0, there is no
# grant.
return-grant work=kv v=50
----
kv-regular: returnGrant(50)
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: 0, elastic-disk-bw-tokens-avail: 153722867280912830
# As soon as the tokens > 0, it will grant.
return-grant work=kv v=1
----
kv-regular: returnGrant(1)
kv-regular: granted in chain 0, and returning 100
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: -99, elastic-disk-bw-tokens-avail: 153722867280912830
# Have waiting requests for kv-elastic too.
set-has-waiting-requests work=kv-elastic v=true
----
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: -99, elastic-disk-bw-tokens-avail: 153722867280912830
# The kv-elastic waiting requests need 200 tokens each.
set-return-value-from-granted work=kv-elastic v=200
----
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: -99, elastic-disk-bw-tokens-avail: 153722867280912830
# Since there are regular requests waiting, those are granted first.
return-grant work=kv-elastic v=400
----
kv-elastic: returnGrant(400)
kv-regular: granted in chain 0, and returning 100
kv-regular: granted in chain 0, and returning 100
kv-regular: granted in chain 0, and returning 100
kv-regular: granted in chain 0, and returning 100
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: -99, elastic-disk-bw-tokens-avail: 153722867280913230
# No more regular requests waiting.
set-has-waiting-requests work=kv v=false
----
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: -99, elastic-disk-bw-tokens-avail: 153722867280913230
# kv-elastic is granted.
set-io-tokens tokens=100
----
kv-elastic: granted in chain 0, and returning 200
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: -199, elastic-disk-bw-tokens-avail: 153722867280913030
set-elastic-disk-bw-tokens tokens=50
----
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: -199, elastic-disk-bw-tokens-avail: 50
# Both kinds of tokens are decremented and become negative.
set-io-tokens tokens=200
----
kv-elastic: granted in chain 0, and returning 200
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: -199, elastic-disk-bw-tokens-avail: -150
# IO tokens become positive. But no grant to elastic work since
# elastic-disk-bw tokens are negative.
set-io-tokens tokens=300
----
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: 101, elastic-disk-bw-tokens-avail: -150
# Regular kv work can get tokens.
try-get work=kv v=10
----
kv-regular: tryGet(10) returned true
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: 91, elastic-disk-bw-tokens-avail: -150
# Elastic kv work cannot get tokens.
try-get work=kv-elastic v=10
----
kv-elastic: tryGet(10) returned false
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: 91, elastic-disk-bw-tokens-avail: -150
# Still negative.
set-elastic-disk-bw-tokens tokens=50
----
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: 91, elastic-disk-bw-tokens-avail: -100
# Even more IO tokens.
set-io-tokens tokens=400
----
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: 400, elastic-disk-bw-tokens-avail: -100
# Finally both tokens are positive and we grant until the elastic-disk-bw
# tokens become negative.
set-elastic-disk-bw-tokens tokens=120
----
kv-elastic: granted in chain 0, and returning 200
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: 200, elastic-disk-bw-tokens-avail: -180
# Models are 0.5x+50, so 0.5*40+50=70. So 70-10=60 additional tokens are
# needed for disk-bw. For io tokens we also apply the ingest model so
# 0.5*0+50=50, which means 110 additional tokens are needed.
store-write-done work=kv-elastic orig-tokens=10 write-bytes=40
----
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: 90, elastic-disk-bw-tokens-avail: -240
store-write-done work=kv orig-tokens=400 write-bytes=40
----
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: 370, elastic-disk-bw-tokens-avail: -240
# Both tokens become positive, so one work is granted.
store-write-done work=kv-elastic orig-tokens=400 write-bytes=40
----
kv-elastic: granted in chain 0, and returning 200
GrantCoordinator:
(chain: id: 0 active: false index: 5) io-avail: 450, elastic-disk-bw-tokens-avail: -110
#####################################################################
# Test soft slots
init-grant-coordinator min-cpu=1 max-cpu=6 sql-kv-tokens=2 sql-sql-tokens=1 sql-leaf=2 sql-root=1
----
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 6 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
try-get-soft-slots slots=2
----
requested: 2, granted: 1
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 6 used-soft: 1 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
try-get-soft-slots slots=2
----
requested: 2, granted: 0
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 6 used-soft: 1 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
return-soft-slots slots=1
----
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 6 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
try-get-soft-slots slots=2
----
requested: 2, granted: 1
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 6 used-soft: 1 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
cpu-load runnable=0 procs=4 clamp=100
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 0, high(moderate)-total: 2(2) moderate-clamp: 100 used-soft: 1 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
try-get-soft-slots slots=2
----
requested: 2, granted: 1
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 0, high(moderate)-total: 2(2) moderate-clamp: 100 used-soft: 2 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
# Over-commitment.
try-get work=kv
----
kv: tryGet(1) returned true
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 1, high(moderate)-total: 2(2) moderate-clamp: 100 used-soft: 2 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
# Over-commitment.
try-get work=kv
----
kv: tryGet(1) returned true
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 2, high(moderate)-total: 2(2) moderate-clamp: 100 used-soft: 2 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
try-get work=kv
----
kv: tryGet(1) returned false
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 2, high(moderate)-total: 2(2) moderate-clamp: 100 used-soft: 2 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
# No longer over-committed.
return-soft-slots slots=2
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 2, high(moderate)-total: 2(2) moderate-clamp: 100 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
try-get-soft-slots slots=2
----
requested: 2, granted: 0
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 2, high(moderate)-total: 2(2) moderate-clamp: 100 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
cpu-load runnable=4 procs=8 clamp=100
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 2, high(moderate)-total: 3(2) moderate-clamp: 100 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
try-get-soft-slots slots=2
----
requested: 2, granted: 0
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 2, high(moderate)-total: 3(2) moderate-clamp: 100 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
cpu-load runnable=1 procs=8 clamp=100
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 2, high(moderate)-total: 3(3) moderate-clamp: 100 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
try-get-soft-slots slots=2
----
requested: 2, granted: 1
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 2, high(moderate)-total: 3(3) moderate-clamp: 100 used-soft: 1 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
cpu-load runnable=3 procs=8 clamp=100
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 2, high(moderate)-total: 4(3) moderate-clamp: 100 used-soft: 1 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
return-grant work=kv
----
kv: returnGrant(1)
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 1, high(moderate)-total: 4(3) moderate-clamp: 100 used-soft: 1 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
try-get-soft-slots slots=2
----
requested: 2, granted: 1
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 1, high(moderate)-total: 4(3) moderate-clamp: 100 used-soft: 2 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
cpu-load runnable=2 procs=8 clamp=100
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 1, high(moderate)-total: 4(4) moderate-clamp: 100 used-soft: 2 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
cpu-load runnable=2 procs=8 clamp=100
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 1, high(moderate)-total: 4(4) moderate-clamp: 100 used-soft: 2 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
try-get-soft-slots slots=2
----
requested: 2, granted: 1
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 1, high(moderate)-total: 4(4) moderate-clamp: 100 used-soft: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
cpu-load runnable=2 procs=8 clamp=100
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 1, high(moderate)-total: 5(5) moderate-clamp: 100 used-soft: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
cpu-load runnable=6 procs=8 clamp=100
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 1, high(moderate)-total: 5(4) moderate-clamp: 100 used-soft: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
cpu-load runnable=6 procs=8 clamp=100
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 1, high(moderate)-total: 5(3) moderate-clamp: 100 used-soft: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
cpu-load runnable=6 procs=8 clamp=100
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 1, high(moderate)-total: 5(3) moderate-clamp: 100 used-soft: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
#####################################################################
# Test soft slots is not higher than regular slots.
init-grant-coordinator min-cpu=1 max-cpu=6 sql-kv-tokens=2 sql-sql-tokens=1 sql-leaf=2 sql-root=1
----
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 6 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
try-get-soft-slots slots=1
----
requested: 1, granted: 1
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 6 used-soft: 1 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
cpu-load runnable=2 procs=8 clamp=100
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 0, high(moderate)-total: 2(2) moderate-clamp: 100 used-soft: 1 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
try-get-soft-slots slots=1
----
requested: 1, granted: 1
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 0, high(moderate)-total: 2(2) moderate-clamp: 100 used-soft: 2 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
cpu-load runnable=2 procs=8 clamp=100
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 0, high(moderate)-total: 3(3) moderate-clamp: 100 used-soft: 2 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
return-soft-slots slots=2
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 0, high(moderate)-total: 3(3) moderate-clamp: 100 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
cpu-load runnable=10 procs=8 clamp=100
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 0, high(moderate)-total: 3(3) moderate-clamp: 100 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
try-get work=kv
----
kv: tryGet(1) returned true
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 1, high(moderate)-total: 3(3) moderate-clamp: 100 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
try-get work=kv
----
kv: tryGet(1) returned true
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 2, high(moderate)-total: 3(3) moderate-clamp: 100 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
try-get work=kv
----
kv: tryGet(1) returned true
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 3, high(moderate)-total: 3(3) moderate-clamp: 100 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
cpu-load runnable=10 procs=8 clamp=100
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 3, high(moderate)-total: 2(2) moderate-clamp: 100 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
#####################################################################
# Test clamping down on total moderate slots.
init-grant-coordinator min-cpu=1 max-cpu=100 sql-kv-tokens=2 sql-sql-tokens=1 sql-leaf=2 sql-root=1
----
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 100 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
try-get-soft-slots slots=1
----
requested: 1, granted: 1
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 100 used-soft: 1 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
cpu-load runnable=0 procs=8
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 0, high(moderate)-total: 2(2) moderate-clamp: 4 used-soft: 1 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
try-get-soft-slots slots=1
----
requested: 1, granted: 1
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 0, high(moderate)-total: 2(2) moderate-clamp: 4 used-soft: 2 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
cpu-load runnable=0 procs=2
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 0, high(moderate)-total: 3(1) moderate-clamp: 1 used-soft: 2 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
# The moderate slots clamp is set to -1, because 10/2-6=-1.
cpu-load runnable=6 procs=10
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 0, high(moderate)-total: 3(0) moderate-clamp: -1 used-soft: 2 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
# Making sure total moderate slots is set to 0, and not a negative value.
cpu-load runnable=6 procs=10
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 0, high(moderate)-total: 3(0) moderate-clamp: -1 used-soft: 2 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
#####################################################################
# Make sure the moderate slots clamp has no effect when it is higher than the total moderate slots.
init-grant-coordinator min-cpu=1 max-cpu=3 sql-kv-tokens=2 sql-sql-tokens=1 sql-leaf=2 sql-root=1
----
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
try-get-soft-slots slots=1
----
requested: 1, granted: 1
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 3 used-soft: 1 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
# Should increase total moderate slots to 2, since the moderate clamp was 3 which is higher.
cpu-load runnable=0 procs=2 clamp=3
----
GrantCoordinator:
(chain: id: 1 active: false index: 5) kv: used: 0, high(moderate)-total: 2(2) moderate-clamp: 3 used-soft: 1 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
init-grant-coordinator min-cpu=1 max-cpu=3 sql-kv-tokens=2 sql-sql-tokens=1 sql-leaf=2 sql-root=1 enabled-soft-slot-granting=false
----
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1
try-get-soft-slots slots=1
----
requested: 1, granted: 0
GrantCoordinator:
(chain: id: 1 active: false index: 0) kv: used: 0, high(moderate)-total: 1(1) moderate-clamp: 3 sql-kv-response: avail: 2
sql-sql-response: avail: 1 sql-leaf-start: used: 0, total: 2 sql-root-start: used: 0, total: 1