Commit graph

7388 commits

Author SHA1 Message Date
Todd Gruben
a1a9103f62 restore column translate keys 2021-05-21 09:27:08 -05:00
Todd Gruben
329f86033d restore field translate keys 2021-05-21 09:27:08 -05:00
Todd Gruben
69245ee209 shard import 2021-05-21 09:27:08 -05:00
Todd Gruben
42b465b80c load schema 2021-05-21 09:27:08 -05:00
Todd Gruben
9d24fb07b7 wired in restore command 2021-05-21 09:27:08 -05:00
Todd Gruben
169dc30d62 api compiles 2021-05-21 09:27:08 -05:00
Todd Gruben
7c6423587a skeleton restore 2021-05-21 09:27:08 -05:00
seebs
b784dd88d9
Merge pull request #1602 from seebs/addgo116
add go 1.16.3 to circleci
2021-05-20 18:43:04 -05:00
Seebs
ac5964480b add go 1.16.3 to circleci
Since we're starting to use this more, add it to the matrix. We should
probably make it our default later, but for now let's just start testing
it.
2021-05-20 17:25:07 -05:00
seebs
2f95bd2de8
Merge pull request #1593 from seebs/getTx
write operations can cause deadlocks in GetTx
2021-05-20 17:09:08 -05:00
Seebs
1c7a6da37b write operations can cause deadlocks in GetTx
The GetTx logic is deeply broken, this DOES NOT fix the underlying
bug.

When any call anywhere in a given set of calls has a top-level write,
we perform all transactions as write transactions, and we do not cache or
share those transactions. This means that anything which causes a
second GetTx for the same index/shard deadlocks against itself.

The two easy to find cases by casual inspection are time quantums
and Not queries, so this addresses those, but this should NOT be
considered a general fix.
2021-05-20 16:41:38 -05:00
seebs
479d668045
Merge pull request #1601 from seebs/noTxBitmap
drop unused TxBitmap
2021-05-20 16:41:18 -05:00
Seebs
7cf0ea452a drop unused TxBitmap
TxBitmap was a workaround for performance problems with doing
individual-bit operations directly on RBF, used only in the
large-writes path of importValue. With importValue no longer
using that path, ever, there are zero remaining users of TxBitmap,
and the test for it no longer exercises it.

Solution: Remove it.
2021-05-20 16:28:19 -05:00
seebs
a46e14ef22
Merge pull request #1598 from seebs/importSpeedups
improve performance of importValue in most cases, switching to consistently use importPositions.
2021-05-20 16:26:38 -05:00
seebs
45255d050f
Merge branch 'master' into importSpeedups 2021-05-20 15:42:11 -05:00
Ben Johnson
4ea655a707
Merge pull request #1596 from molecula/cluster-backup
[CORE-501] Add support for clustered backups
2021-05-20 14:32:23 -06:00
Ben Johnson
94d45a36ed
Merge branch 'master' into cluster-backup 2021-05-20 14:10:27 -06:00
Seebs
4bad5defb6 sort import values stably without using sort.Stable
sort.Stable has horrible runtime -- O(n*logn*logn) -- but if we
don't use sort.Stable, our logic for ensuring that we apply the
"last" value for a given column is actually completely wrong in
the first place.
2021-05-20 12:39:27 -05:00
Seebs
7572acb450 drop "another shard" test as it's probably not valid
We've got a fairly consistent thing of the API splitting data up
into shards before sending it to a field, which it has to do because
of clustering, so we don't intend to support the case where you
have data from another shard in a data set.

Also drop the identical but mislabeled test from TestIntField's
corresponding case.
2021-05-20 12:39:27 -05:00
Seebs
aa4a23b2d9 generate sorted positions from bulkImportStandard
Ensure that positions are sorted, and that we don't generate the same
position more than once.
2021-05-20 12:39:27 -05:00
Seebs
7c4b91eef0 simplify field ImportValue
There's only ever one view in importValue, but there's also only ever
one shard, because importValue is only called by things called from
the API after it has split everything up by shard.
2021-05-20 12:39:27 -05:00
Seebs
d2b925d296 make importValueSmallWrite faster and also the only path
Since we don't always have "snapshots" anymore, the arguable benefit of
avoiding the snapshot is reduced, and the primary expense of
importPositions has been dramatically reduced as well, so let's
just use that all the time, and simplify life.

We also want to make it faster. We don't know how many bits there
are to set or clear in the input set, but we do know exactly how
many bits there are to set AND clear. We can subdivide these into
batches by rows, then process each batch by storing sets at the
bottom and clears at the top. We can also do batches by columns,
reducing the memory overhead of unpacking all the bits at once.

(For extra credit, we could alternate set/clear settings, and
thus do batches of "the clears from row 0, followed by the clears
from row 1" and "the sets from row 1, followed by the sets from
row 2", and so on, but this is too fancy.)

Every caller of importValue is in fact already providing values
with column IDs sorted. As such, we don't need a map for checking
the previously-set columns; we just need to check against the
previous value.
2021-05-20 12:39:27 -05:00
Maxton Huff
741dd2d1ca
Merge pull request #1590 from Maxtonian/longmessage
[CORE-279] Bad query parameters gives error with super long list of shards
2021-05-20 10:40:12 -05:00
Maxton Huff
d9d360aa4d
Merge branch 'master' into longmessage 2021-05-20 10:17:04 -05:00
Maxton Huff
e646d7ac79 wrap mapper error with shards by node 2021-05-20 09:55:42 -05:00
Seebs
bb40d6589f change addOrRemove to not sort inputs
We also implement, but disable for now, a check for sortedness of
inputs. This check was useful in development but it's expensive (about
5% of CPU time for large inputs!) and once we've verified that we
can make it through tests without triggering it, we're probably fine.
2021-05-19 17:36:57 -05:00
Seebs
671a0cf5c6 tweak ImportValue benchmark
With timestamps, we probably want to at least check larger BSI fields,
so we add that. Also, tweak the interpretation of b.N (making each
N count for 10,000 bits) so we can see allocation load at all. But we
also reduce the sparse set to be about one bit per 19 bits, because
if we do one per 70,000, and are doing field-at-a-time imports, we're
getting hundreds of imports to try to match a target of, say, around
a million values.

We also sort the inputs, because ImportValue is about to start requiring
that, since the API does it anyway.

Also, extend this to be available on Fields, because field.ImportValue
is ALSO doing things which could be inefficient or expensive.
2021-05-19 16:40:34 -05:00
Ben Johnson
a4f282c8e8 Allow backup to stdout 2021-05-19 15:04:36 -06:00
Maxton Huff
04bf214f81 remove shard list from mapper error message to avoid duplicate output 2021-05-19 12:20:39 -05:00
Ben Johnson
eb79c35cbd Add support for clustered backups 2021-05-18 15:17:28 -06:00
Nia
ed5359468d
Merge pull request #1592 from niaow/remove-attr
[CORE-421] Remove attributes
2021-05-14 12:34:04 -04:00
Nia Weiss
7fe37a83f4
update license header check exceptions
When moving the protobuf files around, the paths to the generated protobuf files were not updated.
This change updates the paths.
2021-05-14 10:45:46 -04:00
Nia Weiss
f4ba34247f
remove attributes
Attributes are unmaintained and unused.
They have become more of a liability than a benefit.
This change eliminates them from the codebase.
The only user-visible change (assuming that attrs are not used) is that the attrs field will no longer appear in row JSON.
2021-05-14 10:28:08 -04:00
Maxton Huff
53da35eb00 add missing String() calls in error messages 2021-05-13 12:01:12 -05:00
Maxton Huff
63196e7981 add String() to shard slices to reduce error length 2021-05-13 11:39:23 -05:00
Kuba Podgórski
e4be3583d7
Merge pull request #1585 from kuba--/available-shards
[CORE-493] Write remote available shards to etcd, instead of local file.
2021-05-12 18:32:08 +02:00
Kuba Podgórski
79eaae7881
Update field_internal_test.go 2021-05-12 17:02:36 +02:00
Kuba Podgórski
1e6b8434eb
Merge branch 'master' into available-shards 2021-05-11 11:53:35 +02:00
Matthew Jaffee
649ce77dd6
Merge pull request #1589 from jaffee/update-lattice
Update to latest UI including Lookup functionality
2021-05-10 19:46:40 -05:00
Matthew Jaffee
c83099bc8a update lattice submodule, should include all the lookup/postgres changes 2021-05-10 17:29:42 -05:00
seebs
e49192af69
Merge pull request #1580 from seebs/mutexOverwrite
[CORE-533] Improve performance on mutex fields with sparse writes
2021-05-10 15:07:54 -05:00
seebs
82bb067d8e
Merge branch 'master' into mutexOverwrite 2021-05-10 14:48:56 -05:00
Maxton Huff
2467431caf
Merge pull request #1588 from Maxtonian/inspect2
[CORE-459] Investigate- Panic accessing "/inspect" in Molecula 4.1.1
2021-05-10 14:46:39 -05:00
Maxton Huff
e21382fab8 remove handleInspect and inspect validator 2021-05-10 13:14:50 -05:00
Kuba Podgórski
606f664fcc remove unused 2021-05-10 20:02:13 +02:00
Kuba Podgórski
17f89f1bf6 flush bytes instead of roaring 2021-05-10 19:20:34 +02:00
Seebs
130b17b621 don't force immediate recalculate of cache on every update
When writing things that cause additions to the cache, mark it dirty and
flag it for recomputing, but only sometimes actually do the recalculation,
currently implying a 10-second window. We still mark the cache dirty,
so if a request comes in, we'll get fresh data, but the query will be
slowed down because the recomputation will happen then. But that's better
than doing thousands of recalculations which are never used...
2021-05-10 11:58:18 -05:00
Seebs
1e00b50953 gratuitously fancy logic for array/array callbacks
When searching for a small array in a large array, scanning ahead
is productive. The switch from counting indexes to reslicing the
slice appears to improve performance in this case. The fairly arbitrary
value `na << 2` is like `nb / 4 > na` except that it computes faster,
and lets us avoid the expensive overhead unless we have reason to
expect that there's significantly more items in b than in a.

Improvements: Not huge in some cases, but sometimes quite noticeable,
especially as the frequency of overlap increases, which is also
the expensive case in other ways.

name                                              old time/op  new time/op  delta
ImportMutexSampleData/64K/2Kr/40/none/write-0-8    501ms ± 4%   486ms ± 2%     ~     (p=0.052 n=6+5)
ImportMutexSampleData/64K/2Kr/40/none/write-1-8    756ms ± 5%   698ms ± 5%   -7.62%  (p=0.002 n=6+6)
ImportMutexSampleData/64K/2Kr/80/none/write-0-8    292ms ± 3%   276ms ± 4%   -5.46%  (p=0.002 n=6+6)
ImportMutexSampleData/64K/2Kr/80/none/write-1-8    511ms ± 6%   482ms ± 4%   -5.72%  (p=0.015 n=6+6)
ImportMutexSampleData/64K/2Kr/240/none/write-0-8   153ms ± 3%   132ms ± 5%  -13.91%  (p=0.008 n=5+5)
ImportMutexSampleData/64K/2Kr/240/none/write-1-8   354ms ± 2%   215ms ± 6%  -39.41%  (p=0.004 n=5+6)
ImportMutexSampleData/1K/2Kr/40/none/write-0-8     565ms ± 3%   543ms ± 3%   -3.89%  (p=0.015 n=6+6)
ImportMutexSampleData/1K/2Kr/40/none/write-1-8     807ms ± 6%   778ms ± 3%     ~     (p=0.180 n=6+6)
ImportMutexSampleData/1K/2Kr/80/none/write-0-8     317ms ± 3%   300ms ± 1%   -5.40%  (p=0.002 n=6+6)
ImportMutexSampleData/1K/2Kr/80/none/write-1-8     462ms ± 3%   437ms ± 4%   -5.31%  (p=0.009 n=6+6)
ImportMutexSampleData/1K/2Kr/240/none/write-0-8    141ms ± 1%   119ms ± 2%  -15.85%  (p=0.004 n=5+6)
ImportMutexSampleData/1K/2Kr/240/none/write-1-8    213ms ± 3%   171ms ± 3%  -19.70%  (p=0.002 n=6+6)
2021-05-10 11:58:18 -05:00
Seebs
54f5cc799c performance hackery: add intersectCallback for use in running callbacks
In BitmapBitmapFilter.ConsiderData, we intersect things solely in order
to perform callbacks on them. Creating these intermediate arrays is
actually somewhat expensive, and all we're going to do with them is
make callbacks anyway.

So, we add a new `intersectCallback`, which behaves similarly to
`intersectionCount`, but which dramatically reduces the amount of memory
allocation associated with doing the callbacks; in some test cases
on mutex data, this code was >90% of all memory allocations, and
getting rid of that helps a lot.

At that point, we no longer need the separate intersectAny check,
because it doesn't save us any time anymore.
2021-05-10 11:58:18 -05:00
Seebs
ffb796448c make mutex tests smarter
The mutex tests had weird and un-idiomatic definitions for b.N, and
in particular would report ludicrously low times for high values of
b.N because they'd still only do a small amount of importing, then
get counted as having done a much larger number of iterations. Also,
the computation of the number of values to create was pretty noticably
wrong so the secondary data set was unduly tiny.

Do tests with ranked cache and larger row counts because we have
reason to suspect that the cache behavior is mattering. We adjust the
range of tests performed to reflect real world data a bit. We also
drop the "don't do large mutex tests" thing because the insanely
bad performance on larger mutex data should be fixed now, we hope.
2021-05-10 11:58:18 -05:00