Commit graph

5531 commits

Author SHA1 Message Date
Seebs
ff153459ee
union many things at once to cut down allocations 2019-07-25 08:12:19 -05:00
Ashley Svetlik
ae4d86e69a
Merge branch 'master' into pdk2 2019-07-24 16:45:05 -05:00
Ashley Svetlik
7320eeac4d
Merge pull request #2046 from asvetlik/admin2
Updated Open File Limit in Administration Doc
2019-07-24 16:02:00 -05:00
Ashley Svetlik
e45d03687b Improved wording in text and table 2019-07-24 10:49:47 -05:00
Ashley Svetlik
6e6c591f62 Added max url links 2019-07-24 10:41:54 -05:00
Ashley Svetlik
27e62c40cf Improved Open File Limit section wording 2019-07-24 10:22:09 -05:00
Ashley Svetlik
be218fd963 Updated Open File Limit Section 2019-07-24 09:38:06 -05:00
Ashley Svetlik
6d58db4fc9 Updated Pilosa Schema table and added pdk repo link 2019-07-24 09:32:18 -05:00
Matthew Jaffee
bd00f1bfe2
Merge pull request #2034 from jaffee/worker-pool
Worker pool
2019-07-15 14:48:39 -05:00
Matt Jaffee
9a453ef51a
expose worker pool size to config, so we can set it lower in tests
we are experiencing issues with CI where it fails with race: limit on
8128 simultaneously alive goroutines is exceeded, dying

this, despite the fact that closing the executor should clean up all
worker goroutines. Apparently in CircleCI runtime.NumCPU() reports 36,
so the goroutines added up quickly.
2019-07-15 14:25:40 -05:00
Matt Jaffee
a7d9b0a5ae
make sure workers are done when closing via a WaitGroup
still running out of goroutines in race tests in CI, so hopefully this
fixes that.
2019-07-15 08:36:22 -05:00
Matt Jaffee
7d7a5539ca
make executor work chan smaller, add executor.Close
the size of the work chan probably doesn't matter... there is some
discussion of this on the associated PR
https://github.com/pilosa/pilosa/pull/2034
may test with an unbuffered channel as well.

Closing the executor avoids leaking goroutines which seems to be an
issue while running the test suite.
2019-07-15 07:56:57 -05:00
Matt Jaffee
4e55a1fd73
add worker pool to executor for local query processing
Pilosa previously spawned a goroutine for each remote node that a
query needed to be forwarded to, and then forwarded a single request
containing all the shards that the query should operate on. It then
spawned a goroutine *per local shard* to process the query
locally. This was fine if there weren't too many shards, or too many
queries coming in concurrently, but we found that it created issues
when there were 100s or 1000s of shards per node, and dozens of
queries arriving concurrently.

Specifically, the memberlist "hiccup" issue is highly correlated with
many goroutine scenarios, and after applying this patch, memberlist
complaints in the logs were much decreased, and nodeLeave events under
concurrent query load almost entirely eliminated.

This patch creates a fixed size pool of goroutines to do local shard
processing, and passes work to them through a channel, one job per
query per shard. Handling of remote requests (forwarding queries) is
unchanged.

We set the pool size to NumCPU()+8 somewhat arbitrarily, but this
seemed to work pretty well in our testing on 32 core machines. It's a
pretty big improvement over launching a goroutine per shard per query
which is what we were doing previously, so we can tune it more later
if necessary.
2019-07-12 17:16:48 -05:00
Matt Jaffee
ec09582f44
get read lock only where possible in Holder 2019-07-12 13:36:56 -05:00
Yuce Tekol
430b8a6118
Merge pull request #2033 from yuce/fixes-2009
Fixes #2009
2019-07-09 21:27:10 +03:00
Yuce Tekol
30036387cc
add remove at version 2.0 notices 2019-07-09 21:13:51 +03:00
Yuce Tekol
bc0098ccbe
Merge branch 'master' into fixes-2009 2019-07-09 21:11:43 +03:00
Yuce Tekol
6e6efc3d96
Merge pull request #2032 from yuce/fix-min-max-row-pb-result
fixes #2031
2019-07-09 16:50:07 +03:00
Yuce Tekol
d6bb5c65de
Fixes #2009 2019-07-09 16:41:18 +03:00
Yuce Tekol
150c2a0cfa
fixes #2031 2019-07-09 12:25:18 +03:00
asvetlik
c2cbaddba8
Merge pull request #2028 from asvetlik/master
Getting Started Update
2019-07-03 15:34:06 -05:00
asvetlik
42a1d851cb
Merge branch 'master' into master 2019-07-03 15:06:58 -05:00
Matthew Jaffee
8b2e257171
Merge pull request #2029 from jaffee/disable-tracing
add ability to disable tracing and use nopTracer
2019-07-03 15:02:54 -05:00
Ashley Svetlik
c6e840ea30 Fixed jq note link 2019-07-03 14:12:11 -05:00
Ashley Svetlik
2db061ac21 Reformatted Schema Check 2019-07-03 14:02:00 -05:00
Ashley Svetlik
daad23b388 Made review chnages 2019-07-03 13:52:18 -05:00
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
Ashley Svetlik
614bcff1e0 Deleted redundant paragraph in Sample Project 2019-07-03 08:12:58 -05:00
Ashley Svetlik
e38983782c Fixed Schema check note 2019-07-02 15:35:07 -05:00
Ashley Svetlik
f991df206c Made Schema check into note 2019-07-02 15:24:56 -05:00
Ashley Svetlik
36c75ea416 Removed Note before schema check 2019-07-02 15:21:16 -05:00
Ashley Svetlik
f40958fd5a Improved documentation wording 2019-07-02 11:27:27 -05:00
Ashley Svetlik
636c7d2966 Made syntax, format, and wording corrections 2019-07-01 16:42:46 -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
Ashley Svetlik
c8e68c8456 Revised to include review comments 2019-07-01 08:43:22 -05:00
Ashley Svetlik
9d7273e061 Added the Sample Project subsections to left nav area 2019-06-28 12:39:14 -05:00
Ashley Svetlik
680b0119a9 Added explanation and fixed typos 2019-06-28 11:44:52 -05:00