Commit graph

7731 commits

Author SHA1 Message Date
kcrodgers24
efcb0768db wip 2021-09-14 07:31:23 -07:00
kcrodgers24
ba10b3dfde add support for ARM64 2021-09-14 07:31:23 -07:00
seebs
1b3e441645
Merge pull request #1697 from seebs/mutexFix
add clusters to MutexCheck test, fix silly bug revealed by doing so
2021-09-14 09:07:56 -05:00
tgruben
66871c70a8
Merge branch 'master' into mutexFix 2021-09-14 08:27:02 -05:00
nagamocha3000
248ec8ebff
Merge pull request #1677 from nagamocha3000/ha_key_translation
CORE-837 Perform partial replication for index keys
2021-09-14 10:53:44 +03:00
nagamocha3000
575854df8a Make index-key replication more resilient to network failures 2021-09-14 03:12:52 +03:00
Seebs
72444f3b87 add clusters to MutexCheck test, fix silly bug revealed by doing so
The merge lists behavior was flawed in that it would drop one item
from the list per merge, which means that, with high replication
and low number of distinct items, it could even produce an empty
list.

The actual "is there anything wrong" logic is fine, but the list of
clashing values set for a given record is not.

Unfortunately this also doubles the time the test takes, to
21 seconds on MacOS. OW.
2021-09-13 16:25:15 -05:00
seebs
0d568b0d52
Merge pull request #1687 from seebs/core850
make details optional and support limits on mutex checks
2021-09-09 16:17:53 -05:00
Seebs
e27085da66 check context occasionally while processing mutex check results
It's hard to do this remotely sanely for the fragments, but the
translation and collation process itself could be fairly slow on
large data sets, so we should check occasionally for canceled
context and return early if no one needs the result anyway.

Also, take out no-longer-correct comments from the test case.
2021-09-08 13:47:15 -05:00
Seebs
26d38c0ee0 make details optional and support limits on mutex checks
We support query parameters for details (default false) which
request additional data, and for a limit (default 0/MaxInt32)
on number of results returned to limit the amount of spam
produced if there's a lot of results. The simpler default
output should reduce load and runtime significantly, and the
ability to specify limits makes it easier to get reasonably
small responses.

There's some context support here, but the underlying filters
don't take contexts or check for them, which is probably
a flaw but might be a bit large to correct for this.
Despite being large, this set of changes is actually
fairly well contained within the mutex-checking code.
2021-09-08 11:59:47 -05:00
Ben Johnson
484fcd8cf2
Merge pull request #1684 from molecula/sql-select
CORE-807: Implement non-aggregate SELECT query
2021-09-08 08:26:25 -06:00
Ben Johnson
92646cbdf7 Implement non-aggregate SELECT query 2021-09-08 08:09:54 -06:00
seebs
1586861ed2
Merge pull request #1685 from seebs/fewerSlowTests
drop rbf_bolt tests from CI
2021-09-07 16:41:17 -05:00
Seebs
37b55c190f drop rbf_bolt tests from CI
The rbf_bolt tests are unusually expensive, partially because they're
run with the race detector on, but also because it's basically running
two copies of all the tests and comparing them... But they haven't
detected anything in ages, because the RBF stuff is now pretty stable,
and those tests take about twice as long as anything else in our testing,
and thus impede our workflow noticably for little-to-no return. We might
some day want to fully remove them, but for now, just taking them out of
CI should streamline our workflows a bit.
2021-09-07 14:06:23 -05:00
seebs
a3368c64ab
Merge pull request #1681 from seebs/core850
mutex sanity-check endpoints to allow for checking possible mutex corruption
2021-09-07 14:02:44 -05:00
seebs
7586cc0724
Merge branch 'master' into core850 2021-09-07 13:11:31 -05:00
seebs
674fbadd0f
Merge pull request #1680 from seebs/mutexFixes
Mutex fixes -- these address a couple of cases in which mutexes could end up with duplicate values, and also improve the testing so they're more likely to get caught.
2021-09-07 13:11:22 -05:00
tgruben
2a3a5285de
Merge branch 'master' into mutexFixes 2021-09-07 12:45:04 -05:00
Seebs
b391ab9153 mutex sanity-check
This implements a fairly straightforward sanity-check for mutexes,
implemented as a bitmapfilter at the fragment level, and with higher
levels combining results. There's two endpoints, an internal endpoint
which only checks the local node's shards, and an external one which
forwards requests (using the internal endpoint) to all the other nodes.

The internal endpoint does not do key translation, the external one
does.

The transmission format is a probably-inefficient JSON blob, and
returns data separated per-shard so we don't have as much merging
work to do.

This introduces a horrifying monstrosity function which tries to
sneakily corrupt mutex fields and which has to be exported (EWWWWW)
but which is only present in _test code (!??!! THIS WORKS WHY).

Also one typo fix in unrelated code caused by not wanting to keep
fighting with gofmt about this.
2021-09-07 12:41:49 -05:00
rachithrr
5ae2abcfaa
Merge pull request #1682 from rachithrr/ingesttool
CORE-747: Build tooling to provide datagen-like functionality that uses the API
2021-09-03 12:55:55 -04:00
tgruben
170dda1145
Merge branch 'master' into ingesttool 2021-09-03 09:11:25 -05:00
rachithrr
43b34c7d84 CORE-747: Build tooling to provide datagen-like functionality that uses the API
Featurebase
2021-09-02 10:18:50 -04:00
Seebs
0701f9b7dd fix broken intersectionCallback functions
Two of the intersectionCallback functions were broken.

In intersectionCallbackArrayArray, when checking to see whether we can
skip ahead 8, we need to check whether that last value is lower than
the one we're looking for, not whether the first value is.

For intersectionCallbackArrayBitmap, actually implement it at all;
it had never gotten modified significantly from the original
intersectionCount, so it still counted and returned intersections, but
never called the callback at all.
2021-08-31 13:45:59 -05:00
Seebs
6dc8cd7b49 improve mutex import testing
When doing the import tests, import all the data sets if there's
multiple data sets, and check that we're producing the correct number of
results including overwriting previous values, not just that we produce
the same number of values that we set, which shouldn't happen if there's
any overlap.

Also add a specific test that triggers the case I first ran into this for.
2021-08-30 14:16:15 -05:00
Ben Johnson
408e3f84b3
Merge pull request #1679 from molecula/sql-where
CORE-808: Handle SQL WHERE clause
2021-08-26 08:44:15 -06:00
Ben Johnson
6bf854862b Handle SQL WHERE clause 2021-08-26 08:25:16 -06:00
seebs
397f90896b
Prototype ingest API
This is the prototype of the new JSON ingest API. It's not for external use yet, it's still experimental.
2021-08-20 13:26:36 -05:00
Seebs
bb1d52a385 ingest and ingest/codec testing work
This is a design to let us write test cases for ingest with schema setup
and data in the json formats we want to use, and results as alternating
queries and expected results, so we can just create new test files and
run the tests against them. We also have to report back what we created
when creating things.

In the process of developing this, I noticed that the documentation describes
ingest schema as allowing more than one schema operation, but we didn't support
this, and also it wouldn't do much good because there was no way to do partial
things like "just add a field". Fixed.

Also we implement comparison for ops, so the test output is actually
a test rather than just some data to visually eyeball.

In the process, realize that the handling of timestamps was wrong; we said that we
take them as raw numbers relative to the epoch, not as raw Unix timestamps.

Also a couple of related cleanups caught by doing the testing.
2021-08-19 09:50:59 -05:00
nagamocha3000
3185fe4181 Add schema endpoint
This adds the schema and ingest endpoints. (Code actually by Brandon,
seebs just squashed the commits.)
2021-08-19 09:50:59 -05:00
Seebs
e167f1c7fa fancier shard-sorting
This is a rework of Nia's radix sort. Still using stdlib sort for the
tail ends of things, and should probably replace it at some point
because it's still woefully inefficient, but this gets decent
performance, and lets us do the fancy thing of doing quick partial
sorting by record-key-only to get to shards, then deciding whether
to sort by value-then-record (as for a set field) or just by record
(as for int fields), which lets us reduce the amount of re-sorting
the same data by different criteria we do.

We also use a messy code-duplication basically-bubblesort for the
inner loops because it's much cheaper for small N.

This also lets us use field-aware sorting for shards, sorting them
correctly for a corresponding field type, and add corresponding API
support and fragment support for an option to tell the fragment
code that we already ordered things in the order that's most
efficient there, to avoid a second sort that we don't otherwise
need.
2021-08-19 09:50:59 -05:00
Seebs
016765d8a2 Prototype ingest API
This partially-implemented prototype of the ingest API is based on our
programmatic ingest API reference. It has noticable limitations, most
crucially that it doesn't handle multi-node clusters right now. However,
it basically implements the expected semantics.

There's some noticeable performance issues to do with the high overhead
of sorting bits in order to import them efficiently, but this is fixable.

We also add the hooks to the internal client, and make the finisher logic
a bit smarter.

Much of this code was originally by Nia Weiss, but it's been merged
and restructured a bit to get things broken into logical commits.
2021-08-19 09:50:59 -05:00
Matthew Jaffee
61f3fa23b0
Merge pull request #1676 from seebs/prep
ingest API prep work
2021-08-19 09:08:28 -05:00
Seebs
423cddbdbb avoid allocations in viewsByTime
This is sort of horrible, but viewsByTime was about 25% of total CPU time in
the ingest path, NOT including increased GC overhead. This overoptimized
approach to letting us recycle a buffer, and use the same buffer for multiple
time views at once, reduces that to about 2.5%. Sorry for the mess.

We also streamline the process of building the per-view data sets a bit,
and streamline it a lot in the non-time-quantum case.
2021-08-18 13:45:36 -05:00
Seebs
f019cc7409 make import correctly reflect that it needs a single shard always
In fact, we have a number of things assuming that values passed to Import
always fit within a single known shard, so, drop all the extra complexity
around this, drop the computation of fancy view/shard keys, and so on.

There's a lot of room left to improve this probably but it's at least
better, I think.

Unfortunately, there's a handful of things, basically all of which are
test cases, which were relying on this, so, we also add functionality
for splitting import requests by shards. But this allows us to stop
duplicating each shard's inputs one at a time... which turns out to
mean that we now care that the import operation can write back to the
import request. This only affects test cases, so we adopt a crufty
hack involving cloning import requests in those rare cases, and also
when reusing the same column IDs to write to the existence field that
we'd be using later to write to another field.

Note that even if we weren't overwriting the column IDs with positions,
we'd be sorting the column/row ID lists by row-then-column, which means
we'd still be corrupting the column ID lists. This may want to change
at some point.

We also reuse a single Tx for all the views, because DB-per-shard
means that should work fine, and reduces the cost of doing these
updates, probably.
2021-08-18 13:45:36 -05:00
Seebs
6af987a5ba fix error formatting/spelling
Go convention is that error messages don't end with periods and
don't start with capital letters.
2021-08-18 13:45:36 -05:00
Seebs
ab9b70d7e8 mapperLocal: actually leave loop on read from done channel
staticcheck points out that the break is otherwise an ineffective
break because it just ends the current case clause of the switch
it's in, which is true.
2021-08-18 13:45:36 -05:00
Seebs
1745a93aee allow "us" for microseconds in timestamp units
The convention of using a "u" for "micro" is pretty well-established and some
people will have trouble typing the Greek letter, accept that as a synonym.
2021-08-18 13:45:36 -05:00
Seebs
e768fc89ea stop using pointers to time.Time
We're reading timestamps as []int64, instead of allocating a time.Time
for each timestamp, just use the same logic to determine whether to use the
int64 timestamp that we would have used to decide whether to allocate it.
We still have to check the whole run, though, because we're providing a large
list of 0s instead of "no timestamps", for Reasons.
2021-08-18 13:45:36 -05:00
Seebs
35faa39b20 don't use nil qcx
A nil Qcx is a crime against existence and makes baby pandas cry.

Having taken out the hack that tried to accommodate this when tests did it,
we now have to fix the tests. Oh no.
2021-08-18 13:45:36 -05:00
Seebs
dab8dff9c2 make "subdivide list by shardwidth" available for reuse
We keep wanting this, and it's shardwidth-dependent code, and we keep rewriting it.
It should be in the shardwidth package.
2021-08-18 13:45:20 -05:00
Seebs
7b27a48d7c allow Molecula copyrights 2021-08-17 15:23:31 -05:00
Ben Johnson
409d59e297
Merge pull request #1675 from molecula/sql-count
CORE-806: Implement basic SQL COUNT(*) query
2021-08-17 14:12:40 -06:00
Ben Johnson
702f55964f Add apt-get update flag 2021-08-17 07:21:40 -06:00
Ben Johnson
5122c2decc Refactor SQL planner to inside Server 2021-08-16 13:12:16 -06:00
Ben Johnson
9b8dc3d7e6 Implement basic SQL COUNT(*) query 2021-08-13 10:41:39 -06:00
Matthew Jaffee
dac6234d0d
Merge pull request #1671 from jaffee/differentiate-map-error
differentiate error messages between opening file and mapping it
2021-08-09 12:27:22 -05:00
Matthew Jaffee
207634aea3 differentiate error messages between opening file and mapping it 2021-08-09 11:42:25 -05:00
Matthew Jaffee
54a4c2a587
Merge pull request #1663 from molecula/fully-disable-usage-endpoint
CORE-800 Disable /ui/usage endpoint completely when usage-duty-cycle is set to 0
2021-08-05 09:37:10 -05:00
Alan Bernstein
9565620f4d Disable /ui/usage endpoint completely when usage-duty-cycle is set to 0 2021-08-04 16:22:55 -05:00
Alan Bernstein
51cc29364c
Merge pull request #1669 from molecula/feature/syang/aggregate-sort
CLOUD-61: Add aggregate sort option to query builder
2021-08-02 20:46:58 -05:00