Commit graph

4990 commits

Author SHA1 Message Date
Matt Jaffee
efd424ebab
add ability to disable tracing and use nopTracer
Have found some potential performance or stability issues associated
with lots of mutex blocking in getting a parent span's context. Want
the ability to totally disable tracing to help debugging.
2019-07-03 11:02:59 -05:00
Matthew Jaffee
9df46353e7
Merge pull request #2024 from seebs/unmarshal3
Unmarshal3
2019-07-01 14:39:40 -05:00
Seebs
0960d66c94
update diagnostic message, use read locks for read
Annoyingly, this is actually the only place we can make
a read-only lock, because the row() call might write to
the row cache, so it needs the write lock. We might be
able to fix that later, though.
2019-07-01 13:16:03 -05:00
Seebs
e1fbed51b2
use symbolic names for op types, add checks for invalid types 2019-07-01 13:16:03 -05:00
Seebs
b74956e48e
drop no-longer-used timeout case 2019-07-01 13:16:02 -05:00
Seebs
17eb13702e
address lint concerns
Addressing various lint.

incrementOpN no longer returns errors, because it no longer waits for
the snapshot, so checking those errors is unnecessary.

Several fields in a common embedded structure were "unused" according
to a naive checker.

Other tiny style things, and one actual unchecked error. Yay linters!
2019-07-01 13:16:02 -05:00
Seebs
5e3d01febe
lock fragment to compute rows
If you don't hold the fragment lock when computing rows, it's
pretty reasonable for other stuff to be able to modify it -- which
could invalidate or race the enumeration.

Some calls to f.rows were being made with the lock held, others
weren't, so we introduce `f.unprotectedRows` which has the obvious
semantics. (Without which this looked great except that several
of the tests deadlocked.)
2019-07-01 13:16:02 -05:00
Seebs
cb50a5a48b
revert BSIv2 change impact on Official Roaring
The Pilosa roaring format uses two bytes of its
header, next to the magic number, for a version. The
official roaring format uses them for a container
count, if and only if it's the version of the format
that uses run-length containers.

But if it is, it really does need those bits. Also,
since we never use the official format in our internals
or snapshots, we don't have any reason to support
reading flag bits in it, since the flag bits are used
only for internals of fragments and snapshots. So
we revert the change to support flags with official
roaring bitmaps.

A couple of the fuzz tests happened to rely on this,
and we may find more issues with more fuzzing.
2019-07-01 13:16:02 -05:00
Seebs
67830b74cf
allow importRoaring to work with official format roaring
I didn't think of this, because we don't use it much in the
client. This is a bit hairy because really official roaring
is two fairly different formats, one with runs and one without.
2019-07-01 13:16:02 -05:00
Seebs
4b657c1962
use a queue for snapshot operations
As the size of a fragment grows, the cost of snapshots
increases; with a large fragment getting a lot of large writes,
every write will trigger a snapshot, while any other writes have
to wait for that snapshot before they, too, can trigger a snapshot.

To address this, we introduce a background queue of snapshots.
In general, operations which were omitting their ops log writes
and just snapshotting no longer do; they emit an ops log. This does
mean that, in some cases, the ops log is written and then a snapshot
takes place essentially immediately, which costs us some performance.
However, that only actually happens under very light load; under
heavier load, there's generally going to be multiple writes coalesced
into each snapshot, and the ops log writes for them will be much
cheaper than a full snapshot.
2019-07-01 13:16:02 -05:00
Seebs
b369dace69
remap storage on reopen, instead of remarshalling it
When we do a snapshot, we may end up with containers which are
mmapped to the old file, and containers which have allocated storage
identical to the contents of the new file. It would be nicer if they
were mapped to it. But unmarshalling the entire file is expensive.

Instead, we remap it. (Or, if we couldn't mmap it, just make sure
the old stuff is no longer using the old storage space before we
munmap it.)
2019-07-01 13:16:02 -05:00
Seebs
565288f6c2
use ImportRoaringBits to implement importRoaring
Instead of fancy bitmap ops or ImportPositions, we use the
recently-added ImportRoaringBits operations, which can dump
themselves to op logs much more efficiently, and which are
also usually much more efficient than things like "create a
new bitmap which is a copy of the old one".
2019-07-01 13:16:02 -05:00
Seebs
7f1763e466
address fuzz testing for new op types
The new op type code changed the failure mode for
one of the fuzz test issues -- and the fuzz test revealed a
bug in the code. Fixed the code, updated the test to expect
the newer, better, message.

Also fixed capitalization on the old message.
2019-07-01 13:16:01 -05:00
Seebs
c19b7af0d0
Support direct roaring import operations
We add a new ops log type(pair), AddRoaring and RemoveRoaring,
which set and clear the bits from a provided roaring bitmap.

This also compels us to consider additional sanity checking
during tests.
2019-07-01 13:16:01 -05:00
Seebs
4d1e9ed78a
reshuffle benchmarks and include cache type in testing
It turns out there's some significant potential improvements to
be had in the case where there's no cache being used on a field, so
we add it to the benchmarks, to allow testing that.

We also make sure that `getUpdataInto` picks the requested number
of columns; if N was a point at which something weird happens,
we might only sometimes see it.
2019-07-01 13:16:01 -05:00
seebs
72c6867220
Merge pull request #2026 from seebs/viewRace
view.deleteFragment should hold the lock while altering fragments
2019-06-26 22:01:58 -05:00
Seebs
b2fb51be1f view.deleteFragment should hold the lock while altering fragments
If you delete a fragment while something else is calling allFragments,
you can cause a race. This almost never happens in practice, because
deleting fragments is rare, and the only likely overlap would be with
something like the holder cache flush, which only happens once a
minute. But if you slowed down the rest of the tests enough, and ran
with -race, you might see it.

We check v.fragments directly instead of calling v.Fragment, because
v.Fragment also needs a lock, and we don't want to drop the lock between
the check for existence and the delete operation.
2019-06-26 16:14:37 -05:00
asvetlik
03cb21afbd
Merge pull request #2016 from asvetlik/tests
Test for no containers
2019-06-26 10:48:32 -05:00
asvetlik
f54bb5ed2b
Merge branch 'master' into tests 2019-06-26 10:07:20 -05:00
Shaquille Wyan Que
8ea314ac5e
Merge pull request #2023 from shaqque/fuzz-roaring
Add naive implementations of Roaring and fuzz test
2019-06-26 10:07:03 -05:00
asvetlik
91387ba601
Merge branch 'master' into tests 2019-06-26 09:31:37 -05:00
shaqque
368bb46f45 switched naive_test.go to table driven tests 2019-06-25 17:25:07 -05:00
shaqque
7ba9e18a51 Merge branch 'master' of https://github.com/pilosa/pilosa into fuzz-roaring 2019-06-25 11:22:47 -05:00
shaqque
bc0f86755a added roaringsentinel build tag to check for user errors at build time 2019-06-25 11:16:34 -05:00
asvetlik
8fd603637b
Merge pull request #2021 from asvetlik/master
Malformed Offset Bug in readOffsets and readWithRuns
2019-06-25 10:52:21 -05:00
shaqque
4f8b3f650e added go-fuzz testing for roaring ops vs naive implementation 2019-06-25 10:47:53 -05:00
asvetlik
fb841c3327
Merge branch 'master' into master 2019-06-25 08:10:40 -05:00
Shaquille Wyan Que
8760ed77b2
Merge pull request #2019 from shaqque/2015RoaringBugs
Fix various container iteration bugs in Roaring
2019-06-24 22:03:33 -05:00
Shaquille Wyan Que
46121da00a
Merge branch 'master' into 2015RoaringBugs 2019-06-24 21:33:57 -05:00
shaqque
86e703637b fixed seeking end of run container iteration bug when next container exists and ensure roaringparanoia panics before other ops 2019-06-24 15:18:03 -05:00
Ashley Svetlik
f137f00fe3 Merge branch 'master' of https://github.com/asvetlik/pilosa 2019-06-24 13:05:34 -05:00
Ashley Svetlik
db90b798d7 Merge branch 'master' of https://github.com/asvetlik/pilosa 2019-06-24 13:00:30 -05:00
asvetlik
998e89d9d6
Merge pull request #2 from asvetlik/revert-1-master
Revert "Merge pull request #2017 from asvetlik/master"
2019-06-24 12:59:47 -05:00
asvetlik
3a96315a28
Revert "Merge pull request #2017 from asvetlik/master" 2019-06-24 12:59:31 -05:00
asvetlik
3910c6d08f
Merge pull request #1 from pilosa/master
Merge pull request #2017 from asvetlik/master
2019-06-24 12:57:34 -05:00
Ashley Svetlik
55aa864cac Fixed malformed offset bug in readOffsets 2019-06-24 12:55:32 -05:00
Ashley Svetlik
eb5d1ae1a4 Fixed malformed offset bug in readWithRuns 2019-06-24 12:51:10 -05:00
asvetlik
464cc1d4ed
Merge branch 'master' into tests 2019-06-24 12:31:14 -05:00
asvetlik
b70986bcdb
Merge pull request #2017 from asvetlik/master
Malformed bitmap in pilosa fix
2019-06-24 12:31:00 -05:00
Ashley Svetlik
b0165d7ef9 Revised WithErrors test with err corrections 2019-06-24 12:22:51 -05:00
asvetlik
9c5848daeb
Merge branch 'master' into master 2019-06-24 12:13:52 -05:00
Ashley Svetlik
6b6249b86a Merge branch 'tests' of https://github.com/asvetlik/pilosa into tests 2019-06-24 12:13:06 -05:00
Ashley Svetlik
7ff26194d8 Corrected err and checked for err 2019-06-24 12:11:44 -05:00
asvetlik
250a3f6fbb
Merge branch 'master' into tests 2019-06-24 09:02:52 -05:00
Matthew Jaffee
ab6bed1187
Merge pull request #2020 from jaffee/extra-nodeleave-log
more info if nodeleave confirmation queries fail
2019-06-21 14:53:53 -05:00
Matt Jaffee
c0d067b7ee
move context timeout inside loop, so context gets a fresh deadline 2019-06-21 12:15:58 -05:00
Ashley Svetlik
8fd23239a1 Formatted Fuzz_test.go 2019-06-21 10:09:20 -05:00
Shaquille Wyan Que
a6ba7e339c fix container iteration bugs in roaring 2019-06-20 20:50:58 -05:00
Matt Jaffee
481c85acae
more info if nodeleave confirmation queries fail 2019-06-20 17:32:57 -05:00
Ashley Svetlik
031e23cdea Resolved int overflow 2019-06-20 15:02:18 -05:00