Commit graph

7354 commits

Author SHA1 Message Date
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
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
Kuba Podgórski
252fadf6a0 Merge branch 'available-shards' of github.com:kuba--/molecula-pilosa into available-shards 2021-05-10 18:50:24 +02:00
Kuba Podgórski
6bdca67882 replace roaring.Bitmap by [][]byte 2021-05-10 18:45:23 +02:00
Nia
26b49cca21
fix remote available shard races (#3) 2021-05-10 18:36:40 +02:00
Maxton Huff
882327b0a6 remove inspect router 2021-05-10 10:36:24 -05:00
Kuba Podgórski
046b98bdf9
Merge branch 'master' into available-shards 2021-05-10 13:54:43 +02:00
Kuba Podgórski
b36de3146a write shards per node 2021-05-10 13:54:18 +02:00
Ben Johnson
03d258a3db
Merge pull request #1579 from molecula/backup-poc
[CORE-485] Backup CLI
2021-05-07 13:41:07 -06:00
Ben Johnson
e044a489fa
Merge branch 'master' into backup-poc 2021-05-07 13:09:54 -06:00
seebs
a302071b7f
Merge pull request #1587 from seebs/translateKeys
improve key creation/translation performance for large batches, especially on field keys
2021-05-07 14:09:36 -05:00
seebs
c473ff9925
Merge branch 'master' into translateKeys 2021-05-07 13:56:51 -05:00
tgruben
0fe0ae2b66
Merge branch 'master' into backup-poc 2021-05-07 13:37:11 -05:00
Ben Johnson
97cdc2405d
Merge pull request #1586 from molecula/rbf-rr-cache
Fix RBF root record cache build
2021-05-07 12:35:52 -06:00
Seebs
9e6ec3b17a break boltDB operations into chunks
boltDB's bucket.Put() is quadratic on "new keys put into a bucket during
this transaction", which is why BoltDB has warnings not to use it with over
100k new keys at a time. The translation store logic wasn't actually using
that. The actual value picked is smaller, based on some half-baked benchmarking.

We also avoid heap-allocating separate 16-byte (not 8-byte, of course,
because make(...) is *helping*) chunks twice for each key we insert, instead
allocating a single buffer which we reuse for each new transaction.

Also fixed a check against the nilness of the wrong pointer and generally
made CreateKeys and TranslateKeys a little more similar.
2021-05-07 13:19:15 -05:00
Ben Johnson
21c6203438 Fix linter 2021-05-07 11:15:13 -06:00
Ben Johnson
8a161bc423 Fix RBF root record cache build
This commit fixes an issue where the root record cache is only
built when a write transaction successfully commits. However, if
no write transactions are occurring then the the cache is never
built and saved so it is recomputed on every read tx.
2021-05-07 11:10:47 -06:00
Ben Johnson
7e804d7d08 Fix id alloc backup invocation 2021-05-07 10:59:01 -06:00
Ben Johnson
7284c4dd10 Add id alloc, col attrs, & row attrs backup 2021-05-07 10:59:01 -06:00
Todd Gruben
963bb3ec59 enable apiFieldTranslateData apiTranslateData 2021-05-07 10:59:01 -06:00
Ben Johnson
776b43a3cd Backup CLI 2021-05-07 10:59:01 -06:00
Kuba Podgórski
2517ee1bde remove unused 2021-05-07 15:45:30 +02:00
Kuba Podgórski
a79a36232f Write remote available shards to etcd, instead of local file. 2021-05-07 15:33:18 +02:00
Matthew Jaffee
1af85a818b
Merge pull request #1581 from jaffee/portmapper-npe
avoid nil pointer exception when failing to get listener
2021-05-05 14:18:22 -05:00
Matthew Jaffee
8274a8cfee avoid nil pointer exception when failing to get listener
instead of an opaque NPE on the next line, panic with explicit error
telling you what went wrong (in my case it was too many open files)
2021-05-04 15:17:41 -05:00
Alan Bernstein
7d1f9e33b8
Merge pull request #1577 from alanbernstein/core-478-query-history-nanoseconds
CORE-478 Add 'Nanoseconds' units to query-history 'runtime' json key
2021-04-22 20:23:28 -05:00
Alan Bernstein
7ffc103777 Add 'ns' units to query history runtime json 2021-04-22 15:26:15 -05:00
seebs
8c28a5f8ca
Merge pull request #1576 from seebs/ulimit
centralize attempts to set/check limits [CORE-426]
2021-04-21 15:05:23 -05:00
Seebs
1a5696fe23 centralize attempts to set/check limits
We check mmap limits, and try to set/increase our open file limits,
and we check the mmap limit when we start the server, and try to set
the open file limit every time we open a holder.

It's useless to do these things more than once, though. We migrate
these things to be run through a sync.Once, which runs all of them
the first time a server starts up, and then thereafter just returns
the error code from that first run. This should make test startup
ever so slightly cheaper, saving us potentially several microseconds,
but also reducing the spamminess of the message.

I've taken out the `sudo ulimit` advice since it's wrong, and the
documentation link is updated to point to our (now private!)
customer documentation.
2021-04-21 13:56:42 -05:00
seebs
0adc10d2c1
Merge pull request #1578 from seebs/bitmaaaapMaster
roaring ops log and TxBitmap fixes
2021-04-21 12:16:47 -05:00
Seebs
5a7c0971ca additional fragment tests: bitmap file growth, TxBitmap data loss
Checking issues encountered while tracking down an unexpected disk
usage increase.
2021-04-20 12:03:49 -05:00
Seebs
014a94c9c7 TxBitmap: track seen container keys
We can't assume that a container we've seen stays present in our bitmap
after possible remove operations. Solution: Track keys seen.
2021-04-20 12:03:44 -05:00
Seebs
5ffa4ba803 drop "batched" flag from Add operation
The "batched" flag creates a complexity which is that the return value of Add
might or might not be meaningful, but it doesn't really buy us very much.

If we are concerned about the ops log size of writing single ops as 21-byte
arrays of 1 op rather than as 13-byte ops, we can make the AddN code smarter
about how it writes ops. And probably should.

Along with this, change Remove to use the batched operation form, which
writes a more meaningful ops log, and return a meaningful value for changes
made. Otherwise, it ends up writing potentially thousands of ops to the
ops log without reporting any OpN, because the number of ops written isn't
the same as the number of changes those ops made. This could result in
files growing by megabytes without OpN changing.

There was a comment here about a test failing with RemoveN. I can't prove
it, but I strongly suspect that this was actually a result of that test
case hitting a particular bug that we eventually fixed, and which we might
have fixed sooner if we'd realized why using RemoveN made that test
fail.
2021-04-20 12:03:25 -05:00
Seebs
e93d2fe06c bitmap unmarshalling and testing bug fixes
When unmarshalling ops, we weren't adding a meaningful OpN to them,
resulting in misleading reports from `pilosa inspect`. Also, we were
mistakenly reporting things as "mapped" when they were actually
using their internal storage (as with small array containers).

Add the "sanity check" to `pilosa inspect` so that errors like the
above get noticed more easily and corrected. Also, to make that work,
have roaring.InspectBinary actually put containers in the bitmap
it creates rather than just creating info entries for them.
2021-04-20 12:01:21 -05:00
Seebs
ca216a14c5 fix bitmap.BitwiseEqual bugs
bitmap.BitwiseEqual had a couple of subtle bugs, and the net result
is that if the bitmap you were comparing to had an empty container after
the original bitmap ran out of containers, we'd spuriously report
the container as existing and being... the last container in the original,
actually.

Issues are both that we were grabbing the value from the wrong iterator,
and also that we were iterating twice per loop, and thus could also
have missed a non-empty container immediately following an empty one.
2021-04-20 12:01:13 -05:00
Kuba Podgórski
358e4b860e
Merge pull request #1574 from kuba--/public-name-validator
Make validateName function public,
2021-04-16 17:37:39 +02:00