Commit 0abea02
Implement opportunistic boundary completion
Summary:
## Context
Currently, we have a problem with backfills for repos with many commits, and with large working copies near the top of the repo:
Our strategy consists of splitting the repo into "slices" and deriving "boundaries" (the parents of the base commits for a set of slices) from a "predecessor" derived data types.
Deriving a boundary this way does work that's `O(working copy size)`, but it only needs the predecessor type to exist for the commit, instead of the target type to exist for its parent.
This enables us to take advantage of the number of workers we have available as we can parallelize the work, which is necessary for a repo like `configerator` (130M public commits) or `fbsource` (70M public commits).
There is one hiccup with this strategy, though: near the top of a repo like fbsource, the working copy is so large that a single "derive boundaries request" can take weeks to compute.
By that time, it's quite likely that some previous slices caught up, so we're waiting for boundary derivation for nothing and just wasting time.
In practice, it has meant that we have had to fiddle with the backfilling parameters: do a first pass with "slice size" 100k or so, which parallelizes the work optimally,
then do a second pass with "slice size" 5M, which allows to avoid having boundary commits too near the top of the repo where computation is unacceptably expensive.
## Solution
Here, we introduce the concept of "opportunistic boundary completion": instead of always waiting for the "derive from predecessors" calls to finish, we will move on if the commits we are trying to derive
get derived by some other job before we have time to complete them.
This should be strictly more performant, and hopefully will remove a lot of the fiddling work in backfilling large repos.
The entire feature is gated by a JK, because I only trust the implementation so much, and
safe_jk2
`scm/mononoke:derived_data_backfill_opportunistic_boundary_completion`: the jk was created [here](https://www.internalfb.com/intern/justknobs/?name=scm%2Fmononoke#derived_data_backfill_opportunistic_boundary_completion) and set to false for now
Reviewed By: lmvasquezg
Differential Revision: D109853257
fbshipit-source-id: d9008c5889e4b0958a86aff0b31d2ff857be72021 parent 2cb8f7e commit 0abea02
4 files changed
Lines changed: 146 additions & 3 deletions
File tree
- eden/mononoke
- common/mononoke_macros/test_just_knobs
- features/async_requests/worker_lib
- src
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
13 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
14 | 22 | | |
| 23 | + | |
15 | 24 | | |
16 | 25 | | |
17 | 26 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
49 | 53 | | |
50 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
Lines changed: 127 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
67 | 79 | | |
68 | 80 | | |
69 | 81 | | |
| |||
137 | 149 | | |
138 | 150 | | |
139 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
140 | 173 | | |
141 | 174 | | |
142 | 175 | | |
| |||
189 | 222 | | |
190 | 223 | | |
191 | 224 | | |
| 225 | + | |
192 | 226 | | |
193 | 227 | | |
194 | 228 | | |
| |||
198 | 232 | | |
199 | 233 | | |
200 | 234 | | |
201 | | - | |
| 235 | + | |
202 | 236 | | |
203 | 237 | | |
204 | 238 | | |
205 | 239 | | |
206 | 240 | | |
207 | | - | |
208 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
209 | 258 | | |
210 | 259 | | |
211 | 260 | | |
| |||
808 | 857 | | |
809 | 858 | | |
810 | 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 | + | |
0 commit comments