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

Historical queries: Do not fetch entries until an early-enough secret has been fetched #5058

Merged
merged 7 commits into from
Feb 27, 2023

Conversation

eddyashton
Copy link
Member

@eddyashton eddyashton commented Feb 24, 2023

Resolves #5042.

The changes in #5026 meant that historical queries would result in fetches from the host immediately, even if a sufficiently-early secret was not yet known in-enclave. That results in a lot of wasted work - the host fetches and transmits many ledger entries, the enclave discards them as unreadable, repeats periodically - which should eventually resolve, but in instrumented builds exceeds our expected timeouts. This change restores the previous behaviour; entries are only fetched from the host once we have an early-enough secret for them.

There's a few minor performance tweaks associated with this - avoiding double-lookup of the same seqno, and avoiding pessimal sharding of request ranges when some secrets are known.

I'd like to validate this with a few runs through the Daily, and then I will manually backport by including it in #5033 and #5034.
EDIT - Daily looks happy.

@eddyashton eddyashton added 2.x-todo PRs which should be backported to 2.x 3.x-todo PRs which should be backported to 3.x labels Feb 24, 2023
@eddyashton eddyashton requested a review from a team February 24, 2023 09:59
@ghost
Copy link

ghost commented Feb 24, 2023

historical_refactor_fixes@65906 aka 20230227.22 vs main ewma over 20 builds from 65333 to 65885

Click to see table

main

build_id build_number Commit latency factor tpcc_virtual_cft^ ls_virtual_cft^ pi_ls_virtual_cft^ ls_jwt_virtual_cft^ pi_ls_jwt_virtual_cft^ tpcc_sgx_cft^ tpcc_sgx_cft_mem ls_js_virtual_cft^ ls_full_js_virtual_cft^ ls_js_jwt_virtual_cft^ ls_sgx_cft^ ls_sgx_cft_mem pi_ls_sgx_cft^ pi_ls_sgx_cft_mem ls_jwt_sgx_cft^ ls_jwt_sgx_cft_mem pi_ls_jwt_sgx_cft^ pi_ls_jwt_sgx_cft_mem hist_sgx_cft^ ls_js_sgx_cft^ ls_js_sgx_cft_mem ls_full_js_sgx_cft^ ls_full_js_sgx_cft_mem ls_js_jwt_sgx_cft^ ls_js_jwt_sgx_cft_mem RB put (/s)^ CHAMP put (/s)^ RB get (/s)^ CHAMP get (/s)^
65333 20230220.49 0.78117 17354 46065.2 48488.6 12595.2 13267.3 6337.38 8.21863e+07 4608.39 3807.96 3326.69 15893.5 1.50774e+07 16090.4 7.99955e+06 5816.8 1.4291e+07 5783.2 4.59168e+06 24615.3 1537.46 7.73741e+06 1341.82 7.47526e+06 1263.85 6.95098e+06 826783 1.17968e+06 8.15546e+06 3.2511e+07
65344 20230220.53 0.814576 17204.5 43495.4 48698 11587.4 13082.3 5668.99 8.24484e+07 4350.65 3831.07 3287.52 15460.6 1.50774e+07 15994.7 7.99955e+06 5771.4 1.4291e+07 5731.8 4.32954e+06 26614.8 1520.95 7.47526e+06 1334.52 7.21312e+06 1248.25 6.95098e+06 831370 1.17115e+06 8.15238e+06 3.07595e+07
65360 20230220.56 0.823358 17109.3 43630.2 48383.2 12866.6 12843.1 6300.6 8.21863e+07 4385.46 3725.49 3323.02 15709 1.50774e+07 16076.9 7.99955e+06 5790.45 1.4291e+07 5738.8 4.59168e+06 23152.6 1543.25 7.73741e+06 1328.52 7.21312e+06 1266.23 6.95098e+06 832056 1.17678e+06 8.15076e+06 3.07933e+07
65372 20230220.62 0.788533 17256.8 45703.8 47982.6 12452.2 13197.8 6305.11 8.21863e+07 4368.56 3822.36 3395.3 15866.1 1.50774e+07 16153.8 7.99955e+06 5847.76 1.4291e+07 5734 4.59168e+06 42873.7 1542.5 7.73741e+06 1336.99 7.47526e+06 1264.98 6.95098e+06 846468 1.17611e+06 8.15267e+06 3.08466e+07
65388 20230220.67 0.792798 17112.4 44008.9 48921 12452.3 13870.8 6329.01 8.21863e+07 4488.31 3795.98 3319.49 15755.8 1.50774e+07 16141.1 7.99955e+06 5793.8 1.4291e+07 5728.7 4.59168e+06 48473.8 1537.13 7.73741e+06 1339.93 7.21312e+06 1261.9 6.95098e+06 825594 1.1741e+06 8.17395e+06 3.13155e+07
65395 20230220.69 0.787055 17201.2 43790.5 49701.8 12379.1 13052.3 6303.67 8.1662e+07 4630.77 3804.63 3441.09 15805.6 1.50774e+07 16136.2 7.99955e+06 5503.63 1.45532e+07 5671.3 4.06739e+06 45845.4 1528.03 7.73741e+06 1339.44 7.21312e+06 1247.67 6.95098e+06 831800 1.17776e+06 8.15576e+06 3.11488e+07
65405 20230221.3 0.817252 17147.1 43675.1 48039.3 13048.9 13008.5 6348.16 8.1662e+07 4413.92 3831.64 3318.21 15855.9 1.50774e+07 16148.2 7.99955e+06 5511.03 1.45532e+07 5672 4.06739e+06 48277.8 1529.87 7.47526e+06 1342.99 7.21312e+06 1265.42 6.95098e+06 835213 1.17709e+06 8.15397e+06 3.20631e+07
65441 20230221.17 0.80644 17170.1 45602.1 49340.8 12330.1 13749.7 5674.58 8.24484e+07 4662.92 3836.97 3325.78 15754.4 1.50774e+07 16062.6 7.99955e+06 5542.41 1.48153e+07 5669.8 4.06739e+06 44387.9 1522.74 7.73741e+06 1337.52 7.21312e+06 1241.45 6.95098e+06 836782 1.17219e+06 8.13651e+06 3.07961e+07
65456 20230222.2 0.787913 17248.7 45771.5 48055.9 12465.5 13974.3 6308.62 8.21863e+07 4548.91 3893.18 3348.55 15730.7 1.50774e+07 15444.5 7.99955e+06 5480.3 1.48153e+07 5664.5 4.06739e+06 46506.4 1533.77 7.73741e+06 1341.05 7.21312e+06 1254.32 6.95098e+06 825679 1.17963e+06 8.14933e+06 3.08109e+07
65467 20230222.8 0.814029 16922.3 43920.7 49814.5 12640.3 13756.5 6314.31 8.24484e+07 4550.95 3754.76 3419.78 15550.4 1.50774e+07 16096.8 7.99955e+06 5596.93 1.48153e+07 5669.3 4.06739e+06 47792.7 1528.11 7.99955e+06 1336.69 7.99955e+06 1249.71 6.95098e+06 817630 1.17699e+06 8.17395e+06 3.26432e+07
65492 20230222.16 0.792438 17326.4 45738.7 48222.5 12275.5 13721.5 5572.44 8.24484e+07 4400.76 3681.37 3290.5 15412.2 1.50774e+07 16032.5 7.99955e+06 5361.95 1.50774e+07 5633.5 4.06739e+06 47353.8 1537.4 7.99955e+06 1319.06 7.73741e+06 1253.28 6.95098e+06 832455 1.18002e+06 8.17297e+06 3.07291e+07
65534 20230223.2 0.795707 17129.5 45774.3 46241.5 12759.4 12968 6259.09 8.19242e+07 4238.13 3772.11 3431.46 15727.7 1.50774e+07 16064.3 7.99955e+06 5552.7 1.48153e+07 5666.2 4.06739e+06 44436.5 1532.9 7.73741e+06 1339.44 7.73741e+06 1248.39 6.95098e+06 834169 1.17443e+06 8.17164e+06 3.11948e+07
65696 20230224.3 0.800575 17207.2 45541.5 47574.9 12405.1 13902 6272.76 8.21863e+07 4397.4 3826.36 3400.41 15749.8 1.50774e+07 16111.6 7.99955e+06 5534.75 1.48153e+07 5683 4.06739e+06 44456.5 1528.4 7.73741e+06 1341.63 7.21312e+06 1252.52 6.95098e+06 834055 1.18116e+06 8.1567e+06 3.08643e+07
65705 20230224.6 0.78948 17268.8 43549.7 47509.5 12856.2 13058.9 6241.22 8.24484e+07 4410.34 3800.5 3306.36 15498.5 1.53396e+07 16064.6 7.99955e+06 5503.39 1.48153e+07 5677.4 4.06739e+06 48308.6 1540.18 7.73741e+06 1339.13 7.21312e+06 1263.03 6.95098e+06 833135 1.17628e+06 8.13554e+06 3.07438e+07
65748 20230224.16 0.783917 17175.6 43876.7 48773.6 12408.3 13732.1 6234 8.21863e+07 4638.57 3844.13 3343.87 15783 1.50774e+07 16132.6 7.99955e+06 5525.08 1.45532e+07 5703.2 4.06739e+06 43140.2 1541.66 7.73741e+06 1342.66 7.21312e+06 1261.05 6.95098e+06 838176 1.17692e+06 8.14914e+06 3.11625e+07
65835 20230227.2 0.803495 17122.6 43856.6 47985.6 12298.6 12642.2 6323.57 8.1662e+07 4505.39 3736.13 3320.5 15698.9 1.50774e+07 16124.5 7.99955e+06 5482.34 1.45532e+07 5673.2 4.06739e+06 44280.5 1541.99 7.73741e+06 1338.53 7.21312e+06 1254.22 6.95098e+06 841984 1.17778e+06 8.15397e+06 3.08049e+07
65837 20230227.4 0.80932 17317.2 43644.7 48657.8 12696.7 13023.4 6274.57 8.21863e+07 4487.02 3801.1 3329.78 15811.2 1.50774e+07 16164.9 7.99955e+06 5506.78 1.48153e+07 5671.4 4.59168e+06 47709.5 1536.88 7.73741e+06 1343.79 7.21312e+06 1249.28 7.21312e+06 830710 1.17551e+06 8.17418e+06 3.08127e+07
65847 20230227.7 0.798798 17186.7 45859.3 47941.4 12897.6 13185.3 6273.56 8.24484e+07 4348.5 3692.98 3437.49 15827.4 1.50774e+07 16108.4 7.99955e+06 5478.28 1.48153e+07 5675.2 4.06739e+06 45788.5 1534.74 7.73741e+06 1333.8 7.21312e+06 1251.3 6.95098e+06 832584 1.1833e+06 8.15436e+06 3.18919e+07
65877 20230227.15 0.79398 17349.5 43746.6 47761.4 12366.4 13180.4 5664.91 8.24484e+07 4366.45 3665.95 3325.45 15732.6 1.50774e+07 16079 7.99955e+06 5530.31 1.45532e+07 5674.3 4.06739e+06 44624.8 1538.77 7.73741e+06 1344.3 7.73741e+06 1250.19 6.95098e+06 836973 1.18009e+06 8.15556e+06 3.07069e+07
65885 20230227.17 0.797773 17242.7 45737.2 47533.3 12865.5 13860.4 5652.56 8.27106e+07 4380.68 3830.6 3324.1 15799.3 1.50774e+07 16094.7 7.99955e+06 5507.5 1.48153e+07 5639.8 4.32954e+06 44211.7 1526.82 7.73741e+06 1328.99 7.73741e+06 1242 6.95098e+06 835814 1.17601e+06 8.15193e+06 3.08035e+07

historical_refactor_fixes

build_id build_number Commit latency factor tpcc_virtual_cft^ ls_virtual_cft^ tpcc_sgx_cft^ tpcc_sgx_cft_mem pi_ls_virtual_cft^ ls_jwt_virtual_cft^ pi_ls_jwt_virtual_cft^ ls_js_virtual_cft^ ls_sgx_cft^ ls_sgx_cft_mem ls_full_js_virtual_cft^ pi_ls_sgx_cft^ pi_ls_sgx_cft_mem ls_jwt_sgx_cft^ ls_jwt_sgx_cft_mem ls_js_jwt_virtual_cft^ pi_ls_jwt_sgx_cft^ pi_ls_jwt_sgx_cft_mem ls_js_sgx_cft^ ls_js_sgx_cft_mem hist_sgx_cft^ ls_full_js_sgx_cft^ ls_full_js_sgx_cft_mem ls_js_jwt_sgx_cft^ ls_js_jwt_sgx_cft_mem RB put (/s)^ CHAMP put (/s)^ RB get (/s)^ CHAMP get (/s)^
65719 20230224.9 0.820272 17331.4 43756.3 5630.61 8.24484e+07 49397.3 12767.9 13780.6 4412 15637 1.50774e+07 3816.9 16068.7 7.99955e+06 5505.47 1.48153e+07 3452.24 5608 4.06739e+06 1544.82 7.73741e+06 49171.3 1340.73 7.73741e+06 1247.79 6.95098e+06 834057 1.17681e+06 8.03922e+06 3.0816e+07
65743 20230224.14 0.790189 17163.3 45752.4 6304.17 8.24484e+07 48594.9 12329.7 13789.1 4354.49 15730.6 1.50774e+07 3784.51 16100.1 7.99955e+06 5526.21 1.45532e+07 3317.51 5671.2 4.06739e+06 1526.85 7.73741e+06 46318.2 1337.34 7.21312e+06 1251.86 6.95098e+06 836852 1.18217e+06 8.13674e+06 3.12548e+07
65809 20230224.29 0.785616 17199 43872.6 5678.95 8.29727e+07 46816.1 12777 13897.6 4388.97 15509.2 1.50774e+07 3703.6 16002.4 7.99955e+06 5542.09 1.48153e+07 3392.36 5567.6 4.06739e+06 1526.42 7.73741e+06 47988.2 1332.74 7.47526e+06 1248.46 6.95098e+06 840779 1.17283e+06 8.02395e+06 3.0778e+07
65866 20230227.11 0.802665 17183.2 45821 6310.28 8.21863e+07 48136.4 12787.9 13891.8 4425.62 15870.3 1.53396e+07 3779.83 16172.9 7.99955e+06 5540.53 1.45532e+07 3326.7 5714.5 4.06739e+06 1540.63 7.73741e+06 45046.2 1338.64 7.21312e+06 1263.22 6.95098e+06 829817 1.18329e+06 8.1554e+06 3.07988e+07
65906 20230227.22 0.801865 17226.6 43776.5 6344.32 8.1662e+07 46679.2 12662.5 12567.4 4339.8 15874.1 1.50774e+07 3705.18 16158.1 7.99955e+06 5520.28 1.4291e+07 3202.35 5682.9 4.06739e+06 1542.72 7.73741e+06 46192.3 1349.85 7.73741e+06 1259.76 6.68883e+06 797030 1.17362e+06 8.13299e+06 3.07877e+07

images

@eddyashton
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@eddyashton
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@eddyashton eddyashton enabled auto-merge (squash) February 24, 2023 15:33
@eddyashton
Copy link
Member Author

Cherry-picked into #5033 and #5034 for backporting to release/3.x and release/2.x.

@eddyashton eddyashton added the backported This PR was successfully backported to LTS branch label Feb 27, 2023
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 3.x-todo PRs which should be backported to 3.x backported This PR was successfully backported to LTS branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix test_recover_service_with_wrong_identity test case
2 participants