Commit graph

7787 commits

Author SHA1 Message Date
seebs
8fd6ebc8da
Merge pull request #1711 from molecula/seebs/clusterIngest
CORE-826: cluster support for ingest API
2021-09-27 16:22:37 -05:00
Seebs
02d3d24bc5 code review cleanup 2021-09-27 12:05:57 -05:00
Seebs
12882ad147 handle replication
I assumed the existing import code handled replicas. It doesn't, actually.
It just assumes they're handled. So, in the new import code, when splitting
things up by-shard, send each shard's data to *every* node that has
that shard, not just the first one.
2021-09-27 12:05:57 -05:00
Seebs
b3f82ac894 return early on error instead of writing success status also 2021-09-27 12:05:57 -05:00
Seebs
b41f3554da move stableTranslator into test code
It was useful having this in the package to verify code coverage of
the translator, but that having been verified, I'd sort of rather have
it NOT live in the package at all, it's really a testing-only kind
of thing.
2021-09-27 12:05:57 -05:00
Seebs
4bab752fa7 improve comments 2021-09-27 12:05:57 -05:00
Seebs
b78ce29a3e unexport ShardedRequest.Merge
This function absolutely shouldn't be used outside of testing, so I've
made the tests using it internal tests and unexported the method.
2021-09-27 12:05:57 -05:00
Seebs
610c4ed6cb introduce protobuf types for ingest ops
We add a new protobuf type. Also, protoc changed slightly and remade
some tests, in a way which should have no effects but makes the code
*very* slightly cleaner.

This introduces the first testing code in encoding/proto (whoops)
so that scaffolding is a first draft; if you're looking at this code
and the design is a problem go ahead and fix it.

The purpose of this is to verify that we're actually covering all
the branches in the ingest.ShardedRequest and pb.ShardedIngestRequest
message conversions. (Except the top-level one for a nil request,
which isn't checked by this.)

The coverage report doesn't actually include coverage for the ingest
code, though, so we haven't actually properly tested Compare.
Baby steps!
2021-09-27 12:05:57 -05:00
Seebs
9f271467fb ingest cluster support
We add endpoints and protobuf encode/decode to allow for sending
sharded requests over the wire in protobuf, so we can take our
sharded data and send it to other nodes if needed.

This is a squash of >15 other commits, so a bit of history
is relevant:

The Request type had FieldTypes in it because the field type
information was needed for sharding because sorting requires
that information. We change this around to make the external
sharding operation require the field types, and curry that
through the codec -- the codec is needed to tell the request
how it shards. (This is because the correct sorting order
varies by field type.) Requests (and ShardedRequests) no
longer have that table in them.

And then we hit a nasty bug in production and RCA showed
that our testing wasn't good enough and we need to be more
careful, and I discovered that test coverage in this package
was around 70%.

So, the other big thing here is coverage testing; in order to
make coverage testing viable and programmatically testable,
we have added the ability to render requests *back* to
JSON. This is not a great idea, but it does allow us to do
a lot of sanity-checking and verify that the encodings we're
using are consistent and correct.

This, plus some specific tests of decoding specific flawed
inputs, has caught a number of issues. Which are now fixed!

A lot of internal API surface got slightly changed, in ways
that make it simpler to work with. For instance, the
(*FieldOperation).TranslateUnsigned function doesn't really
need to exist; we can just have a non-method translate
function for unsigned and for signed, and use them based on
field type.

The stable translation hack used for testing had a bug that
could allow it to end up producing incorrect results if you
asked it to translate an ID first rather than exclusively
asking it to translate strings first, this has been
corrected. (This is a bug fix in code that was added
partway through creating this, but is tricky enough to
mention its own comment.)

Test coverage is now just over 90%, and a lot of what's left
is error-check returns that may well be actually unreachable
unless, say, the documentation for encoding/json is full of
lies. Which it probably is.
2021-09-27 12:05:57 -05:00
tgruben
214ae4dfac
Merge pull request #1696 from tgruben/looker-count
[CORE-838] Looker Integration
2021-09-27 09:48:31 -05:00
Todd Gruben
c2caa63978 tidy 2021-09-27 08:20:03 -05:00
Todd Gruben
ed1cf7ffef cleanup and applied review suggestions 2021-09-27 07:05:08 -05:00
Todd Gruben
0920c4c029 silence and rebase 2021-09-25 14:06:55 -05:00
Todd Gruben
c4e64528e0 fix 2021-09-25 13:56:36 -05:00
Todd Gruben
2053319db0 silence reporting 2021-09-25 13:53:19 -05:00
Todd Gruben
3baf15226e make lookPQL a package var 2021-09-25 13:53:19 -05:00
Todd Gruben
fc339b9a62 skipp looker comments on PQL 2021-09-25 13:53:19 -05:00
Todd Gruben
5bc1364cdb wip 2021-09-25 13:53:19 -05:00
Todd Gruben
d6dd1e025b removed extra command complete message
cleanup
2021-09-25 13:53:19 -05:00
Todd Gruben
5176b7ff03 added sqlversion config option 2021-09-25 13:53:19 -05:00
Todd Gruben
2ca7b107d2 removed client1 from clustertests 2021-09-25 13:53:19 -05:00
Todd Gruben
9c8538ec5a docker fix not really related to anything 2021-09-25 13:53:19 -05:00
Todd Gruben
c56fd33924 wip 2021-09-25 13:51:02 -05:00
Todd Gruben
419d1ed05d linter cleanup 2021-09-25 13:51:02 -05:00
Todd Gruben
95dc4a1a50 basic looker connection tests pass
sql1 pass through works
2021-09-25 13:51:02 -05:00
Ben Johnson
ab8c42bfd9
Merge pull request #1714 from molecula/sql-col-mapping
CORE-860: Fix SQL column mappings
2021-09-25 11:23:40 -06:00
Ben Johnson
1527eea14b Fix SQL column mappings 2021-09-25 09:36:11 -06:00
Ben Johnson
9f50689509
Merge pull request #1712 from molecula/sql-type-check
Add SQL type checker
2021-09-24 17:07:52 -06:00
Ben Johnson
ff8f0cab96 Add SQL type checking 2021-09-24 14:02:20 -06:00
Samir Patel
ab5e7d4195
Merge pull request #1709 from 54mir/54mir/rename-pilosa-docker2
CORE-859 CORE-839 Rename docker builds to featurebase (with docker fix)
2021-09-23 10:46:50 -05:00
Samir Patel
3403f2f621 Merge branch '54mir/rename-pilosa-docker2' of github.com:54mir/pilosa into 54mir/rename-pilosa-docker2 2021-09-23 10:17:31 -05:00
Samir Patel
5324431ab0 Rename pilosa to featurebase 2021-09-23 10:16:14 -05:00
tgruben
db5143b7af
Merge branch 'master' into 54mir/rename-pilosa-docker2 2021-09-23 10:03:53 -05:00
Matthew Jaffee
930ec3a403
Merge pull request #1672 from jaffee/better-mmap-error
better explanation for 'cannot allocate memory' error
2021-09-23 09:10:09 -05:00
Matthew Jaffee
693606fa80 better explanation for 'cannot allocate memory' error 2021-09-23 08:32:12 -05:00
Samir Patel
839dd1cd43 Remove prints 2021-09-22 16:02:02 -05:00
Samir Patel
4699c840bc More rename to work with backup and cluster tests 2021-09-22 15:41:17 -05:00
Samir Patel
746ffd4bd1 Rename in docker-tag-push 2021-09-22 15:41:09 -05:00
Samir Patel
0ec855766c Rename in make docker-image 2021-09-22 15:41:05 -05:00
Samir Patel
3ca15cc3c4 Rename docker builds to featurebase 2021-09-22 15:41:00 -05:00
Samir Patel
44897d9310 docker fix 2021-09-22 15:35:52 -05:00
Ben Johnson
14fdfe478b
Merge pull request #1708 from molecula/sql-comment
CORE-860: Handle SQL comments during scan
2021-09-21 08:58:23 -06:00
Ben Johnson
ac022ce0ab CORE-860: Handle SQL comments during scan 2021-09-21 08:29:30 -06:00
Ben Johnson
521e4cadb1
Merge pull request #1707 from molecula/sql-group-by
CORE-830: Implement SQL GROUP BY
2021-09-20 08:28:27 -06:00
Ben Johnson
b4cbd45b84 Implement SQL GROUP BY 2021-09-19 08:45:35 -06:00
Matthew Jaffee
0452237b24
Merge pull request #1702 from seebs/bitmapRun
callback logic fixes for intersectionCallback and containerCallback
2021-09-16 16:06:08 -05:00
Matthew Jaffee
3e222d8771 tweak to locking which should avoid stall/deadlock w/ mutex check
The view.go change is straightforward and fairly obviously more
correct.

The field.go change avoids holding the field read lock for the
duration of the mutex check request. The thinking was that while the
read lock was held something else was attempting to get a write lock,
which blocked all other read locks and something was getting into a
loop. Seebs might have a more detailed explanation, but that's as far
as my understanding goes at the moment. I believe this change is safe
though as we don't read/modify any field level data structures after
grabbing the standard view.
2021-09-16 14:07:31 -05:00
Seebs
e7e3331fb4 test intersectionCallback more carefully
This takes our reasonably broad selection of predefined container
types and tries intersectionCallback on each pair of them, comparing
results against the results of plain old intersect(). We've had
several intersectionCallback fixes recently; every one of them
produces test failures here if reverted or broken, so I have at
least some confidence in this coverage.

Similarly, test everything on containerCallback, verifying that
we get the same set of values called back that we get from Slice().

Both of these were verified with -coverprofile to actually be
hitting all the lines of code that aren't insane edge case
checks like "what if a run is in the wrong order".
2021-09-16 14:05:35 -05:00
Seebs
12244dcbed record stats for intersectionCallback under the right name 2021-09-16 14:05:35 -05:00
Seebs
e0dfde9934 appease gofmt 2021-09-16 14:05:35 -05:00