Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build raft with dqlite #153

Merged
merged 1 commit into from
Aug 7, 2024
Merged

Conversation

louiseschmidtgen
Copy link
Contributor

Description

The raft repo is archived we should be building Raft with dqlite.

@louiseschmidtgen louiseschmidtgen requested a review from a team as a code owner August 7, 2024 13:48
Copy link
Contributor

@neoaggelos neoaggelos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, after a green CI

Copy link

github-actions bot commented Aug 7, 2024

Benchmark Result

goos: linux
goarch: amd64
pkg: github.com/canonical/k8s-dqlite/test
cpu: AMD EPYC 7763 64-Core Processor                
                    │    Before    │                After                │
                    │    sec/op    │    sec/op     vs base               │
Compaction/sqlite-4   41.70µ ± 24%   43.03µ ± 10%        ~ (p=1.000 n=7)
Compaction/dqlite-4   44.34µ ±  8%   45.60µ ±  6%        ~ (p=0.535 n=7)
Create/sqlite-4       1.536m ±  5%   1.474m ±  8%        ~ (p=0.128 n=7)
Create/dqlite-4       1.300m ±  5%   1.324m ± 11%        ~ (p=0.805 n=7)
Delete/sqlite-4       1.638m ±  7%   1.727m ± 21%        ~ (p=0.456 n=7)
Delete/dqlite-4       1.491m ±  6%   1.443m ± 11%        ~ (p=0.209 n=7)
Get/sqlite-4          267.4µ ±  1%   268.1µ ±  1%        ~ (p=0.456 n=7)
Get/dqlite-4          356.9µ ±  1%   355.2µ ±  1%        ~ (p=0.383 n=7)
Lease/sqlite-4        101.4µ ±  1%   101.6µ ±  1%        ~ (p=0.209 n=7)
Lease/dqlite-4        101.4µ ±  1%   101.5µ ±  1%        ~ (p=0.902 n=7)
Update/sqlite-4       1.508m ± 12%   1.740m ± 10%  +15.43% (p=0.004 n=7)
Update/dqlite-4       1.467m ±  8%   1.641m ± 10%  +11.88% (p=0.017 n=7)
geomean               405.2µ         415.8µ         +2.64%

                    │        Before        │                    After                     │
                    │ page-cache-misses/op │ page-cache-misses/op  vs base                │
Compaction/sqlite-4           0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Compaction/dqlite-4           0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Create/sqlite-4               0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Create/dqlite-4               0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Delete/sqlite-4               0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Delete/dqlite-4               0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Get/sqlite-4                  0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Get/dqlite-4                  0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Lease/sqlite-4                0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Lease/dqlite-4                0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Update/sqlite-4               0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Update/dqlite-4               0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
geomean                                  ²                         +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                    │        Before        │                    After                     │
                    │ page-cache-spills/op │ page-cache-spills/op  vs base                │
Compaction/sqlite-4           0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Compaction/dqlite-4           0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Create/sqlite-4               0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Create/dqlite-4               0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Delete/sqlite-4               0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Delete/dqlite-4               0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Get/sqlite-4                  0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Get/dqlite-4                  0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Lease/sqlite-4                0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Lease/dqlite-4                0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Update/sqlite-4               0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
Update/dqlite-4               0.000 ± 0%               0.000 ± 0%       ~ (p=1.000 n=7) ¹
geomean                                  ²                         +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                    │    Before     │                After                 │
                    │ page-reads/op │ page-reads/op  vs base               │
Compaction/sqlite-4    12.19 ±   1%     12.25 ±  2%        ~ (p=0.403 n=7)
Compaction/dqlite-4    12.20 ±   1%     12.09 ±  2%   -0.90% (p=0.041 n=7)
Create/sqlite-4        13.75 ±   2%     13.87 ±  1%        ~ (p=0.090 n=7)
Create/dqlite-4        13.71 ±   2%     13.61 ±  1%        ~ (p=0.245 n=7)
Delete/sqlite-4        24.88 ±   2%     24.99 ±  1%        ~ (p=0.318 n=7)
Delete/dqlite-4        24.65 ±   1%     24.58 ±  1%        ~ (p=0.512 n=7)
Get/sqlite-4           14.95 ±   0%     14.96 ±  0%        ~ (p=1.000 n=7)
Get/dqlite-4           11.97 ±   0%     11.96 ±  0%        ~ (p=0.213 n=7)
Lease/sqlite-4        800.0µ ± 100%   1500.0µ ± 47%  +87.50% (p=0.026 n=7)
Lease/dqlite-4        800.0µ ±  50%    800.0µ ± 50%        ~ (p=0.559 n=7)
Update/sqlite-4        24.87 ±   3%     24.20 ±  2%   -2.69% (p=0.005 n=7)
Update/dqlite-4        24.75 ±   2%     24.12 ±  1%   -2.55% (p=0.001 n=7)
geomean                3.213            3.371         +4.90%

                    │     Before     │                 After                  │
                    │ page-writes/op │ page-writes/op  vs base                │
Compaction/sqlite-4    207.8m ± 1%        208.0m ± 1%       ~ (p=0.596 n=7)
Compaction/dqlite-4    187.8m ± 0%        187.6m ± 0%       ~ (p=0.294 n=7)
Create/sqlite-4         5.103 ± 0%         5.105 ± 0%       ~ (p=0.137 n=7)
Create/dqlite-4         4.133 ± 1%         4.133 ± 1%       ~ (p=0.399 n=7)
Delete/sqlite-4         5.327 ± 1%         5.321 ± 1%       ~ (p=0.830 n=7)
Delete/dqlite-4         4.390 ± 1%         4.406 ± 1%       ~ (p=0.170 n=7)
Get/sqlite-4            0.000 ± 0%         0.000 ± 0%       ~ (p=1.000 n=7) ¹
Get/dqlite-4            0.000 ± 0%         0.000 ± 0%       ~ (p=1.000 n=7) ¹
Lease/sqlite-4          0.000 ± 0%         0.000 ± 0%       ~ (p=1.000 n=7) ¹
Lease/dqlite-4          0.000 ± 0%         0.000 ± 0%       ~ (p=1.000 n=7) ¹
Update/sqlite-4         5.140 ± 0%         5.121 ± 1%       ~ (p=0.105 n=7)
Update/dqlite-4         4.154 ± 0%         4.132 ± 0%  -0.53% (p=0.023 n=7)
geomean                            ²                   -0.05%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                    │     Before      │                   After                    │
                    │ sec-reading/op  │ sec-reading/op  vs base                    │
Compaction/sqlite-4   124.7µ ±  19%      118.5µ ±  23%         ~ (p=0.334 n=7)
Compaction/dqlite-4   32.10µ ±  29%      29.70µ ±  33%         ~ (p=0.928 n=7)
Create/sqlite-4       45.50µ ± 760%      34.20µ ±  75%         ~ (p=0.318 n=7)
Create/dqlite-4       10.20µ ±  53%      11.40µ ±  29%         ~ (p=1.000 n=7)
Delete/sqlite-4       288.3µ ±  55%      229.3µ ±  55%         ~ (p=0.209 n=7)
Delete/dqlite-4       47.50µ ±  26%      55.30µ ±  21%         ~ (p=0.097 n=7)
Get/sqlite-4          89.80µ ±   6%      89.30µ ±   4%         ~ (p=0.972 n=7)
Get/dqlite-4          34.00µ ±  11%      33.00µ ±  14%         ~ (p=1.000 n=7)
Lease/sqlite-4        300.0n ±    ?        0.0n ±    ?  -100.00% (p=0.015 n=7)
Lease/dqlite-4         0.000 ±   0%       0.000 ±   0%         ~ (p=1.000 n=7) ¹
Update/sqlite-4       231.4µ ±  69%      160.4µ ± 229%         ~ (p=0.456 n=7)
Update/dqlite-4       88.70µ ±  20%      91.10µ ±  24%         ~ (p=0.805 n=7)
geomean                             ²                   ?                      ² ³
¹ all samples are equal
² summaries must be >0 to compute geomean
³ ratios must be >0 to compute geomean

                    │     Before     │                  After                  │
                    │ sec-writing/op │ sec-writing/op  vs base                 │
Compaction/sqlite-4   10.10µ ± 11%       10.40µ ±  8%        ~ (p=0.304 n=7)
Compaction/dqlite-4   7.100µ ±  6%       6.900µ ±  7%        ~ (p=0.084 n=7)
Create/sqlite-4       1.288m ±  5%       1.219m ±  9%        ~ (p=0.097 n=7)
Create/dqlite-4       38.10µ ± 39%       34.80µ ± 49%        ~ (p=0.921 n=7)
Delete/sqlite-4       1.260m ±  8%       1.330m ± 28%        ~ (p=0.456 n=7)
Delete/dqlite-4       22.10µ ± 38%       21.10µ ± 29%        ~ (p=0.805 n=7)
Get/sqlite-4           0.000 ±  0%        0.000 ±  0%        ~ (p=1.000 n=7) ¹
Get/dqlite-4           0.000 ±  0%        0.000 ±  0%        ~ (p=1.000 n=7) ¹
Lease/sqlite-4         0.000 ±  0%        0.000 ±  0%        ~ (p=1.000 n=7) ¹
Lease/dqlite-4         0.000 ±  0%        0.000 ±  0%        ~ (p=1.000 n=7) ¹
Update/sqlite-4       1.068m ± 18%       1.308m ± 13%  +22.47% (p=0.002 n=7)
Update/dqlite-4       21.80µ ± 23%       20.40µ ± 42%        ~ (p=0.383 n=7)
geomean                            ²                    -0.01%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                    │    Before     │                After                │
                    │     B/op      │     B/op       vs base              │
Compaction/sqlite-4     820.0 ± 44%     840.0 ± 71%       ~ (p=0.620 n=7)
Compaction/dqlite-4   5.533Ki ± 34%   5.161Ki ± 35%       ~ (p=1.000 n=7)
Create/sqlite-4       18.94Ki ±  1%   18.92Ki ±  0%       ~ (p=0.710 n=7)
Create/dqlite-4       17.66Ki ±  0%   17.67Ki ±  0%       ~ (p=0.435 n=7)
Delete/sqlite-4       28.29Ki ±  1%   28.43Ki ±  0%       ~ (p=0.165 n=7)
Delete/dqlite-4       25.29Ki ±  0%   25.28Ki ±  0%  -0.05% (p=0.023 n=7)
Get/sqlite-4          23.31Ki ±  0%   23.31Ki ±  0%       ~ (p=0.678 n=7)
Get/dqlite-4          21.11Ki ±  0%   21.11Ki ±  0%       ~ (p=0.593 n=7)
Lease/sqlite-4        12.33Ki ±  0%   12.33Ki ±  0%       ~ (p=0.636 n=7)
Lease/dqlite-4        12.33Ki ±  0%   12.33Ki ±  0%       ~ (p=0.494 n=7)
Update/sqlite-4       26.09Ki ±  1%   26.17Ki ±  0%  +0.32% (p=0.001 n=7)
Update/dqlite-4       23.42Ki ±  0%   23.45Ki ±  0%  +0.10% (p=0.002 n=7)
geomean               13.82Ki         13.78Ki        -0.31%

                    │   Before    │                After                │
                    │  allocs/op  │  allocs/op   vs base                │
Compaction/sqlite-4   32.00 ± 47%   33.00 ± 76%       ~ (p=0.640 n=7)
Compaction/dqlite-4   135.0 ± 35%   125.0 ± 36%       ~ (p=0.971 n=7)
Create/sqlite-4       419.0 ±  2%   418.0 ±  0%       ~ (p=1.000 n=7)
Create/dqlite-4       335.0 ±  0%   335.0 ±  0%       ~ (p=1.000 n=7)
Delete/sqlite-4       656.0 ±  2%   660.0 ±  1%       ~ (p=0.136 n=7)
Delete/dqlite-4       446.0 ±  0%   446.0 ±  0%       ~ (p=1.000 n=7) ¹
Get/sqlite-4          535.0 ±  0%   535.0 ±  0%       ~ (p=1.000 n=7) ¹
Get/dqlite-4          379.0 ±  0%   379.0 ±  0%       ~ (p=1.000 n=7) ¹
Lease/sqlite-4        224.0 ±  0%   224.0 ±  0%       ~ (p=1.000 n=7) ¹
Lease/dqlite-4        224.0 ±  0%   224.0 ±  0%       ~ (p=1.000 n=7) ¹
Update/sqlite-4       606.0 ±  2%   606.0 ±  0%       ~ (p=0.608 n=7)
Update/dqlite-4       427.0 ±  0%   427.0 ±  0%       ~ (p=0.192 n=7)
geomean               296.8         295.7        -0.35%
¹ all samples are equal

                    │        Before         │                    After                    │
                    │ network-bytes-read/op │ network-bytes-read/op  vs base              │
Compaction/dqlite-4           2.045Ki ± 35%          1.905Ki ±  36%       ~ (p=1.000 n=7)
Create/dqlite-4                 239.4 ±  0%            239.3 ±   0%       ~ (p=0.358 n=7)
Delete/dqlite-4               1.156Ki ±  0%          1.157Ki ±   0%       ~ (p=0.155 n=7)
Get/dqlite-4                  1.133Ki ±  0%          1.134Ki ±   0%       ~ (p=1.000 n=7)
Lease/dqlite-4                0.03280 ± 20%          0.03280 ± 100%       ~ (p=0.192 n=7)
Update/dqlite-4                 564.3 ±  0%            563.5 ±   0%  -0.14% (p=0.001 n=7)
geomean                         152.8                  151.0         -1.17%

                    │          Before          │                     After                      │
                    │ network-bytes-written/op │ network-bytes-written/op  vs base              │
Compaction/dqlite-4               4.602 ±   6%               4.545 ±   6%       ~ (p=1.000 n=7)
Create/dqlite-4                   112.3 ±   2%               112.0 ±   1%       ~ (p=0.502 n=7)
Delete/dqlite-4                   423.5 ±   0%               423.7 ±   0%       ~ (p=0.378 n=7)
Get/dqlite-4                      80.50 ±   0%               80.50 ±   0%       ~ (p=0.759 n=7)
Lease/dqlite-4                  0.01360 ± 341%             0.01360 ± 476%       ~ (p=0.192 n=7)
Update/dqlite-4                   263.5 ±   0%               263.2 ±   0%  -0.11% (p=0.002 n=7)
geomean                           19.95                      19.90         -0.26%
Current status
goos: linux
goarch: amd64
pkg: github.com/canonical/k8s-dqlite/test
cpu: AMD EPYC 7763 64-Core Processor                
                    │    After     │
                    │    sec/op    │
Compaction/sqlite-4   43.03µ ± 10%
Compaction/dqlite-4   45.60µ ±  6%
Create/sqlite-4       1.474m ±  8%
Create/dqlite-4       1.324m ± 11%
Delete/sqlite-4       1.727m ± 21%
Delete/dqlite-4       1.443m ± 11%
Get/sqlite-4          268.1µ ±  1%
Get/dqlite-4          355.2µ ±  1%
Lease/sqlite-4        101.6µ ±  1%
Lease/dqlite-4        101.5µ ±  1%
Update/sqlite-4       1.740m ± 10%
Update/dqlite-4       1.641m ± 10%
geomean               415.8µ

                    │        After         │
                    │ page-cache-misses/op │
Compaction/sqlite-4           0.000 ± 0%
Compaction/dqlite-4           0.000 ± 0%
Create/sqlite-4               0.000 ± 0%
Create/dqlite-4               0.000 ± 0%
Delete/sqlite-4               0.000 ± 0%
Delete/dqlite-4               0.000 ± 0%
Get/sqlite-4                  0.000 ± 0%
Get/dqlite-4                  0.000 ± 0%
Lease/sqlite-4                0.000 ± 0%
Lease/dqlite-4                0.000 ± 0%
Update/sqlite-4               0.000 ± 0%
Update/dqlite-4               0.000 ± 0%
geomean                                  ¹
¹ summaries must be >0 to compute geomean

                    │        After         │
                    │ page-cache-spills/op │
Compaction/sqlite-4           0.000 ± 0%
Compaction/dqlite-4           0.000 ± 0%
Create/sqlite-4               0.000 ± 0%
Create/dqlite-4               0.000 ± 0%
Delete/sqlite-4               0.000 ± 0%
Delete/dqlite-4               0.000 ± 0%
Get/sqlite-4                  0.000 ± 0%
Get/dqlite-4                  0.000 ± 0%
Lease/sqlite-4                0.000 ± 0%
Lease/dqlite-4                0.000 ± 0%
Update/sqlite-4               0.000 ± 0%
Update/dqlite-4               0.000 ± 0%
geomean                                  ¹
¹ summaries must be >0 to compute geomean

                    │     After     │
                    │ page-reads/op │
Compaction/sqlite-4     12.25 ±  2%
Compaction/dqlite-4     12.09 ±  2%
Create/sqlite-4         13.87 ±  1%
Create/dqlite-4         13.61 ±  1%
Delete/sqlite-4         24.99 ±  1%
Delete/dqlite-4         24.58 ±  1%
Get/sqlite-4            14.96 ±  0%
Get/dqlite-4            11.96 ±  0%
Lease/sqlite-4         1.500m ± 47%
Lease/dqlite-4         800.0µ ± 50%
Update/sqlite-4         24.20 ±  2%
Update/dqlite-4         24.12 ±  1%
geomean                 3.371

                    │     After      │
                    │ page-writes/op │
Compaction/sqlite-4    208.0m ± 1%
Compaction/dqlite-4    187.6m ± 0%
Create/sqlite-4         5.105 ± 0%
Create/dqlite-4         4.133 ± 1%
Delete/sqlite-4         5.321 ± 1%
Delete/dqlite-4         4.406 ± 1%
Get/sqlite-4            0.000 ± 0%
Get/dqlite-4            0.000 ± 0%
Lease/sqlite-4          0.000 ± 0%
Lease/dqlite-4          0.000 ± 0%
Update/sqlite-4         5.121 ± 1%
Update/dqlite-4         4.132 ± 0%
geomean                            ¹
¹ summaries must be >0 to compute geomean

                    │      After      │
                    │ sec-reading/op  │
Compaction/sqlite-4   118.5µ ±  23%
Compaction/dqlite-4   29.70µ ±  33%
Create/sqlite-4       34.20µ ±  75%
Create/dqlite-4       11.40µ ±  29%
Delete/sqlite-4       229.3µ ±  55%
Delete/dqlite-4       55.30µ ±  21%
Get/sqlite-4          89.30µ ±   4%
Get/dqlite-4          33.00µ ±  14%
Lease/sqlite-4         0.000 ±    ?
Lease/dqlite-4         0.000 ±   0%
Update/sqlite-4       160.4µ ± 229%
Update/dqlite-4       91.10µ ±  24%
geomean                             ¹
¹ summaries must be >0 to compute geomean

                    │     After      │
                    │ sec-writing/op │
Compaction/sqlite-4   10.40µ ±  8%
Compaction/dqlite-4   6.900µ ±  7%
Create/sqlite-4       1.219m ±  9%
Create/dqlite-4       34.80µ ± 49%
Delete/sqlite-4       1.330m ± 28%
Delete/dqlite-4       21.10µ ± 29%
Get/sqlite-4           0.000 ±  0%
Get/dqlite-4           0.000 ±  0%
Lease/sqlite-4         0.000 ±  0%
Lease/dqlite-4         0.000 ±  0%
Update/sqlite-4       1.308m ± 13%
Update/dqlite-4       20.40µ ± 42%
geomean                            ¹
¹ summaries must be >0 to compute geomean

                    │     After     │
                    │     B/op      │
Compaction/sqlite-4     840.0 ± 71%
Compaction/dqlite-4   5.161Ki ± 35%
Create/sqlite-4       18.92Ki ±  0%
Create/dqlite-4       17.67Ki ±  0%
Delete/sqlite-4       28.43Ki ±  0%
Delete/dqlite-4       25.28Ki ±  0%
Get/sqlite-4          23.31Ki ±  0%
Get/dqlite-4          21.11Ki ±  0%
Lease/sqlite-4        12.33Ki ±  0%
Lease/dqlite-4        12.33Ki ±  0%
Update/sqlite-4       26.17Ki ±  0%
Update/dqlite-4       23.45Ki ±  0%
geomean               13.78Ki

                    │    After    │
                    │  allocs/op  │
Compaction/sqlite-4   33.00 ± 76%
Compaction/dqlite-4   125.0 ± 36%
Create/sqlite-4       418.0 ±  0%
Create/dqlite-4       335.0 ±  0%
Delete/sqlite-4       660.0 ±  1%
Delete/dqlite-4       446.0 ±  0%
Get/sqlite-4          535.0 ±  0%
Get/dqlite-4          379.0 ±  0%
Lease/sqlite-4        224.0 ±  0%
Lease/dqlite-4        224.0 ±  0%
Update/sqlite-4       606.0 ±  0%
Update/dqlite-4       427.0 ±  0%
geomean               295.7

                    │         After         │
                    │ network-bytes-read/op │
Compaction/dqlite-4          1.905Ki ±  36%
Create/dqlite-4                239.3 ±   0%
Delete/dqlite-4              1.157Ki ±   0%
Get/dqlite-4                 1.134Ki ±   0%
Lease/dqlite-4               0.03280 ± 100%
Update/dqlite-4                563.5 ±   0%
geomean                        151.0

                    │          After           │
                    │ network-bytes-written/op │
Compaction/dqlite-4               4.545 ±   6%
Create/dqlite-4                   112.0 ±   1%
Delete/dqlite-4                   423.7 ±   0%
Get/dqlite-4                      80.50 ±   0%
Lease/dqlite-4                  0.01360 ± 476%
Update/dqlite-4                   263.2 ±   0%
geomean                           19.90

@louiseschmidtgen louiseschmidtgen merged commit 4570b1e into master Aug 7, 2024
7 checks passed
cole-miller pushed a commit to cole-miller/k8s-dqlite that referenced this pull request Aug 9, 2024
@louiseschmidtgen louiseschmidtgen deleted the KU-1212/build-raft-with-dqlite branch August 12, 2024 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants