featurebase/roaring
Seebs 3b696da34a plugins and precomputed data
So in some cases, when we do a query, the results of one
part of the query are innately shared-across-nodes; for
instance, a hypothetical Distinct query. More generally,
we allow cross-index queries; calls can have "index=foo"
in them.

This patch lets us handle that without duplicating that
query all over. Before we actually start doing the
separate calls, we run the query once from the coordinating
node, then patch the results in, and send relevant subsets
over to each client, etcetera. Also provides slightly
friendlier (and I hope faster) support for converting
bitmaps to/from sets of rows.

We also add an extension interface, and some fancy stuff
to let us define new calls, which use this. They're sort
of tied together because the first extension I wanted to
implement needed precomputed calls. The extension API
lets us create extensions using `pkg/plugin` (with all its
associated limitations, unfortunately), then query them
at load time for functionality.

This also implies some revamping of the argument
validation for PQL, like verifying that functions exist
and knowing things about their argument types.

So basically this is an overly intrusive patch, and would
be better as separate patches, but they're hard to detangle.

add trivial execution-time profiling

What if you could ?profile=true on a query and get some
numbers back? That'd be really cool.

We already have tracing/spans, but right now, those only generate
any data if you have something set up for them to trace to. Add a
fancy wrapper that lets us generate our own tracing data, and dump
it into the request response, if ?profile=true.

add a sample extension, add missing features to extension interface

Implement a naive probabilistic filter extension as an example of
what an extension looks like. In the process, discover multiple
omissions in the bitmap API. Well, I did *say* it was experimental.
2019-11-12 12:14:29 -06:00
..
testdata cleanup #1622 2018-09-06 16:27:10 -05:00
btree.go double the nolint comments, double the checking 2019-10-11 15:17:51 -05:00
btree_test.go Make containers copy-on-write 2019-05-30 16:36:20 -05:00
container_stash.go plugins and precomputed data 2019-11-12 12:14:29 -06:00
containers_btree.go Support direct roaring import operations 2019-07-01 13:16:01 -05:00
containers_slice.go Support direct roaring import operations 2019-07-01 13:16:01 -05:00
containers_test.go replaced min code with bmp.iterator 2019-06-11 16:58:32 +03:00
fuzz_test.go generalize test strings and break out old UnmarshalBinary code 2019-08-05 17:39:47 -05:00
fuzzer.go added go-fuzz testing for roaring ops vs naive implementation 2019-06-25 10:47:53 -05:00
generation_debug.go Sources and Generations: tracking mmapped files 2019-11-12 12:14:29 -06:00
generation_nodebug.go Sources and Generations: tracking mmapped files 2019-11-12 12:14:29 -06:00
inst.go Add license headers to files missing them and CI check to verify they are present. Fixes #1633 2019-04-12 11:30:41 -05:00
naive.go added go-fuzz testing for roaring ops vs naive implementation 2019-06-25 10:47:53 -05:00
naive_test.go switched naive_test.go to table driven tests 2019-06-25 17:25:07 -05:00
nop_inst.go double the nolint comments, double the checking 2019-10-11 15:17:51 -05:00
README.md Fixed typo 2019-06-17 16:47:28 -05:00
roaring.go plugins and precomputed data 2019-11-12 12:14:29 -06:00
roaring_helpers_test.go Make containers copy-on-write 2019-05-30 16:36:20 -05:00
roaring_internal_test.go generalize test strings and break out old UnmarshalBinary code 2019-08-05 17:39:47 -05:00
roaring_nop_paranoia.go Add license headers to files missing them and CI check to verify they are present. Fixes #1633 2019-04-12 11:30:41 -05:00
roaring_nop_sentinel.go switched naive_test.go to table driven tests 2019-06-25 17:25:07 -05:00
roaring_nop_stats.go Add license headers to files missing them and CI check to verify they are present. Fixes #1633 2019-04-12 11:30:41 -05:00
roaring_paranoia.go Add license headers to files missing them and CI check to verify they are present. Fixes #1633 2019-04-12 11:30:41 -05:00
roaring_sentinel.go switched naive_test.go to table driven tests 2019-06-25 17:25:07 -05:00
roaring_stats.go v2.0.0 2019-10-08 14:56:17 -06:00
roaring_test.go v2.0.0 2019-10-08 14:56:17 -06:00
source.go Sources and Generations: tracking mmapped files 2019-11-12 12:14:29 -06:00
unmarshal_binary.go Sources and Generations: tracking mmapped files 2019-11-12 12:14:29 -06:00

The Fuzzer

For complete documentation on go-fuzz, please see: https://github.com/dvyukov/go-fuzz

The fuzzer in relation to the roaring package checks the Bitmap.UnmarshalBinary function found in roaring.go. In order to use the fuzzer, you can follow these steps:

cd $GOPATH/src/github.com/pilosa/pilosa/roaring

go-fuzz-build ./

You must now make the workdir/corpus directory. This is achieved by:

mkdir workdir/corpus

The fuzzer needs some input to start the fuzzing with. Copy some sample Pilosa fragments into the workdir/corpus folder. For example:

cp ~/.pilosa/my-index/my-field/views/standard/fragments/0 workdir/corpus

Once you have copied your sample inputs, you are ready to run the fuzzer:

go-fuzz -bin=roaring-fuzz.zip -workdir=workdir -func=FuzzBitmapUnmarshalBinary

Understanding the Fuzzer Output

The fuzzer will output something similar to the follwoing:

2015/04/25 12:39:53 workers: 8, corpus: 124 (12s ago), crashers: 37, restarts: 1/15, execs: 35342 (2941/sec), cover: 403, uptime: 12s

The most important part of the output is the crashers and cover. The crashers records how many combinations were discovered that fail and the cover tells you how much code is being accessed. For a complete explanation of the output, please see: https://github.com/dvyukov/go-fuzz.

The fuzzer will document the crashers in a folder labeled "crashers." It will record the fragment and the error that was produced in two separate files within this folder. This is the final product.

Happy Fuzzing!