Commit graph

7817 commits

Author SHA1 Message Date
Ben Johnson
98e7ade591 CORE-809: Aggregate COUNT() with INNER JOIN 2021-10-07 14:20:07 -06:00
seebs
39aa12b12a
Merge pull request #1723 from molecula/seebs/genfix
don't close storage after failing to open cache
2021-10-01 15:52:42 -05:00
Seebs
8433f81b68 don't close storage after failing to open cache
If the inner function that handles the open of storage and cache
fails, we close the fragment. If we closeStorage() before that,
then we can try to close the storage again, which causes a panic
when we try to mark the generation as Done again.

I was going to set f.gen = nil after marking it done, but I'm
not feeling safe about that -- there's too many places where
we check things about f.gen, and it seems unsafe. The generation
code should be removed at some point, because it all exists
as a workaround for not having any way to detect when reads are
"done", because we didn't want to do something huge and intrusive,
like adding the Tx system and requiring transactions to get
closed.
2021-10-01 11:02:45 -05:00
seebs
8ed922d30e
Merge pull request #1720 from molecula/fsync
Fsync
2021-10-01 10:58:13 -05:00
Seebs
9db87f78d0 fix go.mod/go.sum 2021-10-01 10:45:08 -05:00
Seebs
214a1492a8 kill off a ton more fsyncs
Performance of tests on MacOS has been atrocious for a while, and
a lot of that is fsync, so we're trying to make that optional.

To test all of this, I modified RBF to panic if anything tried to
open an RBF database without disabling fsync, and ran the tests that
way, and tracked down the various places this could still happen.

There's a lot of places in our tree where we were creating
test holders which were not getting created with fsync disabled, which
results in a surprisingly large number of points at which we end
up calling fsync in tests, which makes tests much slower than they
need to be. There's also a bunch of places where the flags don't get
propagated correctly; for instance, storage.fsync didn't propagate
to the RBFConfig.

We add an "fsync enabled" flag to OpenTranslateStoreFunc, so we can
tell translation stores that we don't need syncing, so the server's
config can be passed on appropriately.

More of the test code that sets things up is correctly configuring
that flag by default.

We also change the barely-used bolt storage backend to support this as
well.

With this done, the only calls to fsync left in a run of `go test -short`
in the top-level directory are from the zap logger in etcd, and consumed
around 0.03 seconds. The overall impact is that `go test -short`
went from "takes enough more than 10 minutes that i don't know how long
it takes" to about 2.5 minutes.
2021-10-01 10:45:08 -05:00
Seebs
e774acb4a0 disable a few more fsyncs in boltdb
boltdb has a couple of places where it fsyncs even when fsync is
disabled, this turns out to cost an amazing amount of time over
several thousand databases in our test run. In theory, they are
rare circumstances compared to updates; in practice, when you
open 256 partition key translation databases per server opened
and most of them never get written to, not so much.
2021-10-01 10:45:08 -05:00
Seebs
9ac4a5a8f4 don't necessarily fsync RBF databases even on close when fsync is disabled
In test runs, we open, and close, *huge* numbers of databases. Even
the single fsync on close for these ends up being expensive on some
hosts. *cough* Apple. At least in theory, writes delivered to the
disk are just as written whether or not you've hit fsync, as long
as the machine doesn't power off before getting to them. In the
circumstances where we disable fsync, that's fine.

Since we already have an fsync function for "fsync if it's
not disabled", use that.
2021-10-01 10:45:08 -05:00
Seebs
d5b61ee8e8 reduce etcd fsyncs during testing
We disable fsync more consistently in testing, including using
etcd's already-existing UnsafeNoFsync option to disable fsyncs
in the backing store boltdb used by etcd, to reduce runtime of
our tests on MacOS significantly.

Corresponding to this, we update etcd by one patch to pick
up a locally-invented patch which turns out to be nearly-identical
to the upstream fix for "disabling fsync makes boltdb not
even bother to write some data sometimes", which caused crashes
galore.
2021-10-01 10:45:08 -05:00
Samir Patel
231e11ffe8
Merge pull request #1719 from 54mir/54mir/log-roaring-migrate
CORE-874 Add darwin build to roaring-migrate-tool
2021-10-01 10:35:22 -05:00
tgruben
c750717f50
Merge branch 'master' into 54mir/log-roaring-migrate 2021-10-01 10:02:46 -05:00
nagamocha3000
7a597610e2
Merge pull request #1710 from nagamocha3000/core-849-prevent-node-from-blocking-replication-process
CORE-849 Test paused node picks up once cluster state is back to normal
2021-09-30 21:07:48 +03:00
nagamocha3000
c24a5e77ba Test paused node picks up once cluster state is back to normal
This adds the following test:
1. cluster comes up (node 1,2,3), status normal
2. Pause node 3
3. Insert keys making sure to filter out the keys that will go to the paused node
4. Wait for status to become degraded
5. Unpause node 3
6. Wait for status to get back to normal
7. Check that keys were replicated to all 3 nodes
2021-09-30 20:48:01 +03:00
seebs
4648aa9477
Merge pull request #1713 from molecula/seebs/core829
rework executor's per-shard union to use UnionInPlace
2021-09-30 11:26:31 -05:00
Samir Patel
a845d93a25 Add license headers 2021-09-30 09:28:33 -05:00
Samir Patel
5d070b47bb clean up 2021-09-29 15:57:31 -05:00
Samir Patel
feb8997ca8 Add darwin build to roaring-migrate-tool 2021-09-29 15:42:50 -05:00
Seebs
3ef25e4a16 rework executor's per-shard union to use UnionInPlace
The actual code here is mostly jaffee's, but I've reworked it some.

This doesn't directly seem to be using UnionInPlace, but really it
is.

The actual logic inside (*Row).Union is a mess and probably silly
in a few ways, but hardly matters. The important part is that,
instead of calling it once per child as we get them, we gather
all of them at once and then call it on all of them. That gets
us a call to (*Row).Union that does a very elaborate dance to
compute a call to (*rowSegment).Union on the only segment present
in each of those rows, which then does a simpler thing to
call (*Bitmap).Union() with the first response as a receiver
and the rest as parameters, and THAT then ends up calling either
unionIntoTargetSingle() if there's only one other bitmap,
or using UnionInPlace on a Freeze() of the first bitmap, which
gets us (we hope) the benefits of the fancy UnionInPlace logic.

Every part of this is a reminder that we really need to replace
roaring and also the Row/rowSegment stuff some day.
2021-09-29 11:31:13 -05:00
souhailanoor
e5479390b8
Merge pull request #1717 from molecula/CORE-844_webUI_rename
CORE-844: remove Pilosa name and website from curl handler for webUI endpoints
2021-09-28 17:23:51 -05:00
souhailanoor
68d1126ac9
Merge branch 'master' into CORE-844_webUI_rename 2021-09-28 17:12:16 -05:00
Souhaila Noor
49e8c1c69f undid the changes pushed earlier for incrementing the release version 2021-09-28 16:59:54 -05:00
Souhaila Noor
3fe28ca7b9 renamed webUI from Pilosa to FeatureBase and updated version 2021-09-28 16:34:52 -05:00
Ben Johnson
938c425d80
Merge pull request #1716 from molecula/sql-scan
CORE-860: Allow StmtRows.Scan() for more types
2021-09-28 15:06:35 -06:00
tgruben
7cf5e5c804
Merge branch 'master' into sql-scan 2021-09-28 15:52:41 -05:00
Ben Johnson
b7126a5859 Allow StmtRows.Scan() for more types 2021-09-28 13:16:24 -06:00
tgruben
f0b93da070
Merge pull request #1715 from tgruben/cleanup-query
addsql version to handler
2021-09-27 16:37:04 -05:00
tgruben
8861e4528a
Merge branch 'master' into cleanup-query 2021-09-27 16:24:06 -05:00
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
Todd Gruben
79c066a9a0 mod tidy fun 2021-09-27 16:11:27 -05:00
Todd Gruben
2b36625081 missed test handler 2021-09-27 16:04:40 -05:00
Todd Gruben
51876b1821 addsql version to handler 2021-09-27 15:42:14 -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