Commit graph

7750 commits

Author SHA1 Message Date
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
Seebs
3ae12391c7 callback logic fixes for intersectionCallback and containerCallback
The inner loop of intersectionCallbackArrayArray's "fast"
case has
	for len(ca) > 0 && ca[0] < va {
	}
so we do not leave that loop unless len(ca) is 0, or
ca[0] >= va.

We then return from the whole function if len(ca) is 0,
so the only way we finish one iteration of the outer for
loop is if ca[0] >= va. Thus, this can be an `if` rather
than a `for`.

We also fix the logic for ArrayRun to make it require fewer
tests and be clearer about why the tests work and clearer about
always making progress.

And, finally, the bitmap/range callback logic, and the underlying
"callback per bit in word" logic, were both badly broken. In
particular, if a range started and ended in the same word, it would
hit the values in that word twice, once with them incorrectly
shifted, but then it would further garble any offsets past the first
in a word. Eww.
2021-09-16 14:05:35 -05:00
rachithrr
cd1e17d0ba
Merge pull request #1695 from rachithrr/decimal-groupby-added
CORE-777: Added DecimalAgg field in GroupCount to output decimal sum
2021-09-16 10:49:57 -05:00
rachithrr
9e84647e63
Merge branch 'master' into decimal-groupby-added 2021-09-16 09:49:31 -05:00
rachithrr
f549dae625 CORE-777: Added DecimalAgg field in GroupCount to output decimal sum
-created groupCountDecimal
-added test
2021-09-16 09:43:13 -05:00
Kasey C. Rodgers
61c6ffced8
Merge pull request #1690 from molecula/supportARM64-799
add support for ARM64 [CORE-799]
2021-09-14 08:07:09 -07:00
Kasey C. Rodgers
2ae1de8ad6 Update Makefile
corrected typo in docker-release section
2021-09-14 07:31:23 -07:00
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