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

Limit size of recovered ledger entries batch #3986

Merged
merged 12 commits into from
Jun 27, 2022

Conversation

jumaffre
Copy link
Contributor

@jumaffre jumaffre commented Jun 27, 2022

The batching of recovered ledger entries introduced in #3746 causes a bug when the ledger entries to recover are too large. For example, if ledger entries are 2MB each, the recovered batch of 100 entries will be 200MB and will violate the current limit of the size of ring buffer messages (max_msg_size).

To address this, the host now returns however many entries (crudely) can fit within a single ring buffer message and sends this to the enclave for deserialising.

TODO:

  • Unit test
  • Changelog

@jumaffre jumaffre added 2.x-todo PRs which should be backported to 2.x auto-backport Automatically backport this PR to LTS branch labels Jun 27, 2022
@ghost
Copy link

ghost commented Jun 27, 2022

limit_batch_size_recovery@47109 aka 20220627.16 vs main ewma over 20 builds from 46769 to 47079

Click to see table

main

build_id build_number tpcc_sgx_cft^ tpcc_sgx_cft_mem ls_sgx_cft^ ls_sgx_cft_mem ls_jwt_sgx_cft^ ls_jwt_sgx_cft_mem ls_js_sgx_cft^ ls_js_sgx_cft_mem ls_v8_sgx_cft^ ls_v8_sgx_cft_mem ls_full_js_sgx_cft^ ls_full_js_sgx_cft_mem ls_full_v8_sgx_cft^ ls_full_v8_sgx_cft_mem ls_js_jwt_sgx_cft^ ls_js_jwt_sgx_cft_mem hist_sgx_cft^ RB put (/s)^ CHAMP put (/s)^ RB get (/s)^ CHAMP get (/s)^
46769 20220621.6 6611.97 8.40213e+07 19570.5 1.6126e+07 5585.44 1.56017e+07 2551.57 1.00967e+07 1639.97 1.63713e+08 2122.99 9.31027e+06 1444.67 9.81771e+07 2025.16 8.78598e+06 21098.4 928835 1.37754e+06 9.34729e+06 3.53713e+07
46791 20220621.15 6397.4 8.40213e+07 20019.4 1.58639e+07 5665.02 1.53396e+07 2549.13 1.00967e+07 1601.71 1.62927e+08 2123.38 9.31027e+06 1415.65 9.81771e+07 1928.49 9.04813e+06 19934.2 876595 1.40572e+06 9.31748e+06 3.55556e+07
46798 20220621.18 6132.98 8.29727e+07 20152.9 1.6126e+07 5663.11 1.53396e+07 2551.27 9.83456e+06 1618.06 1.63189e+08 2132.93 9.31027e+06 1429.32 9.81771e+07 2020.55 8.78598e+06 19580.5 908764 1.40678e+06 9.30482e+06 3.58663e+07
46809 20220621.23 6400.34 8.37592e+07 19984.6 1.74367e+07 5566.3 1.53396e+07 2547.7 1.00967e+07 1612.33 1.63189e+08 2114.93 9.31027e+06 1431.55 9.73907e+07 1925.46 9.04813e+06 17312.3 910174 1.37689e+06 9.27528e+06 3.56788e+07
46816 20220621.26 6398.52 8.3497e+07 20254.4 1.56017e+07 5663.83 1.53396e+07 2558.67 9.83456e+06 1610.32 1.63189e+08 2120 9.31027e+06 1422.09 9.81771e+07 1931.17 9.04813e+06 21105.3 911270 1.34905e+06 9.34729e+06 3.63759e+07
46833 20220621.33 6439.5 8.37592e+07 20112.7 1.6126e+07 5491.63 1.50774e+07 2608.37 1.00967e+07 1604.5 1.62665e+08 2116.89 9.31027e+06 1431.67 9.81771e+07 1922.96 9.04813e+06 19755.4 888885 1.37173e+06 9.25018e+06 3.58669e+07
46845 20220621.38 6413.39 8.37592e+07 20030.1 1.66503e+07 5643.99 1.53396e+07 2533.64 1.00967e+07 1626.9 1.63975e+08 2113.35 9.04813e+06 1425.43 9.79149e+07 1922.68 1.08831e+07 19896.6 905553 1.3795e+06 9.26278e+06 2.65974e+07
46852 20220621.41 6253.41 8.3497e+07 19865.6 1.6126e+07 5596.92 1.50774e+07 2541.19 1.00967e+07 1622.48 1.62927e+08 2113.35 9.04813e+06 1436.07 9.81771e+07 1923.36 9.04813e+06 20423.9 904912 1.38678e+06 9.26697e+06 3.58669e+07
46867 20220622.2 6367.33 8.32349e+07 19806.3 1.63882e+07 5650.57 1.56017e+07 2547.38 1.00967e+07 1658.65 1.61092e+08 2126.39 9.31027e+06 1442.67 9.84392e+07 1979.17 9.04813e+06 19884.9 925269 1.39651e+06 9.32176e+06 3.59292e+07
46923 20220623.3 6412.19 8.42835e+07 19718.5 1.56017e+07 5529.76 1.53396e+07 2548.51 1.00967e+07 1606.2 1.6083e+08 2150.52 9.31027e+06 1428.4 9.87014e+07 1966.7 9.04813e+06 17422.6 907031 1.38014e+06 9.39441e+06 3.58669e+07
46944 20220623.11 6356.48 8.42835e+07 19329.8 1.6126e+07 5896.78 1.53396e+07 2546.33 1.00967e+07 1603.11 1.63713e+08 2118.8 9.31027e+06 1411.26 9.79149e+07 1880.41 1.08831e+07 17359.5 907066 1.37273e+06 9.27104e+06 3.55549e+07
46971 20220623.21 6450.43 8.3497e+07 19851.3 1.56017e+07 5599.2 1.56017e+07 2536.73 1.00967e+07 1616.63 1.63189e+08 2119.23 9.31027e+06 1432.73 9.84392e+07 2004.27 9.04813e+06 17683.7 908480 1.36442e+06 9.2293e+06 3.58669e+07
46991 20220623.28 6377.41 8.3497e+07 19701.7 1.58639e+07 5385.09 1.56017e+07 2366.82 9.83456e+06 1608.19 1.63189e+08 2136.81 9.31027e+06 1425.25 9.79149e+07 1923.96 9.04813e+06 17504 892332 1.38499e+06 9.16327e+06 3.5993e+07
46997 20220624.2 6517.15 8.42835e+07 19539.1 1.63882e+07 5680.22 1.53396e+07 2548.42 1.00967e+07 1627.67 1.63975e+08 2101.8 9.31027e+06 1411.66 9.84392e+07 1877.44 9.04813e+06 17936 901086 1.37541e+06 9.20445e+06 3.61837e+07
47004 20220624.5 6364.31 8.40213e+07 19814.6 1.58639e+07 5505.52 1.50774e+07 2538.62 1.00967e+07 1621.35 1.63713e+08 2109.83 9.31027e+06 1436.89 9.81771e+07 1882.87 1.14074e+07 17719.4 912344 1.39335e+06 9.55638e+06 3.58029e+07
47030 20220624.15 6395.65 8.32349e+07 19767.8 1.58639e+07 5551.96 1.50774e+07 2560.52 1.00967e+07 1617.71 1.62927e+08 2154.88 9.31027e+06 1444.21 9.87014e+07 1959.08 9.04813e+06 19991.3 867094 1.33969e+06 8.88881e+06 3.48299e+07
47040 20220624.19 6200.67 8.3497e+07 20480.7 1.56017e+07 5544.27 1.53396e+07 2535.79 1.03588e+07 1611.13 1.63189e+08 2143.46 1.11453e+07 1428.45 9.79149e+07 1977.91 1.14074e+07 19041.1 919167 1.34763e+06 9.15921e+06 3.53103e+07
47045 20220624.21 6293.74 8.42835e+07 20611.8 1.56017e+07 5677.4 1.56017e+07 2545.01 1.00967e+07 1634.94 1.62927e+08 2153.23 9.04813e+06 1414.6 9.81771e+07 2016.16 9.04813e+06 24187.4 912610 1.37136e+06 9.28373e+06 3.56174e+07
47077 20220627.3 6315.57 8.50699e+07 20456.9 1.69124e+07 5688.66 1.53396e+07 2548.51 1.00967e+07 1632.56 1.63975e+08 2131.11 9.31027e+06 1434.94 9.84392e+07 1930.11 1.0621e+07 21444.9 891774 1.40389e+06 9.21676e+06 3.58663e+07
47079 20220627.4 6599.46 8.42835e+07 20685 1.6126e+07 5652.05 1.53396e+07 2525.68 1.2456e+07 1628.45 1.62927e+08 2119.64 9.04813e+06 1457.27 9.79149e+07 1920.37 9.04813e+06 20337.3 907071 1.36751e+06 9.38584e+06 3.59298e+07

limit_batch_size_recovery

build_id build_number tpcc_sgx_cft^ tpcc_sgx_cft_mem ls_sgx_cft^ ls_sgx_cft_mem ls_jwt_sgx_cft^ ls_jwt_sgx_cft_mem ls_js_sgx_cft^ ls_js_sgx_cft_mem ls_v8_sgx_cft^ ls_v8_sgx_cft_mem ls_full_js_sgx_cft^ ls_full_js_sgx_cft_mem ls_full_v8_sgx_cft^ ls_full_v8_sgx_cft_mem ls_js_jwt_sgx_cft^ ls_js_jwt_sgx_cft_mem hist_sgx_cft^ RB put (/s)^ CHAMP put (/s)^ RB get (/s)^ CHAMP get (/s)^
47098 20220627.12 6602.61 8.40213e+07 20770.1 1.6126e+07 5706.22 1.53396e+07 2546.15 1.00967e+07 1663.36 1.63189e+08 2127.19 9.31027e+06 1450.12 9.87014e+07 1935.92 1.08831e+07 22399 912900 1.36035e+06 9.22107e+06 3.57417e+07
47109 20220627.16 6157.55 8.37592e+07 20681.1 1.56017e+07 5670.77 1.53396e+07 2547.39 1.00967e+07 1649.25 1.62665e+08 2118.26 9.31027e+06 1465.08 9.79149e+07 1979.33 9.04813e+06 18292.5 866433 1.39385e+06 9.26269e+06 3.56788e+07

images

src/host/ledger.h Outdated Show resolved Hide resolved
src/host/ledger.h Outdated Show resolved Hide resolved
@jumaffre jumaffre marked this pull request as ready for review June 27, 2022 14:51
@jumaffre jumaffre requested a review from a team June 27, 2022 14:51
@jumaffre jumaffre enabled auto-merge (squash) June 27, 2022 14:59
@jumaffre jumaffre merged commit a9225c5 into microsoft:main Jun 27, 2022
@github-actions
Copy link

💔 All backports failed

Status Branch Result
release/2.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

backport --pr 3986

Questions ?

Please refer to the Backport tool documentation

jumaffre added a commit to jumaffre/CCF that referenced this pull request Jun 27, 2022
(cherry picked from commit a9225c5)

# Conflicts:
#	.daily_canary
#	CHANGELOG.md
@jumaffre jumaffre added the backported This PR was successfully backported to LTS branch label Jun 27, 2022
jumaffre added a commit that referenced this pull request Jun 27, 2022
(cherry picked from commit a9225c5)

# Conflicts:
#	.daily_canary
#	CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x-todo PRs which should be backported to 2.x auto-backport Automatically backport this PR to LTS branch backported This PR was successfully backported to LTS branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants