Commit graph

9043 commits

Author SHA1 Message Date
seebs
fae3376581
Merge pull request #1965 from molecula/fb1240
[FB-1240] handle BitN when updating an existing bitmap pointer cell
2022-03-07 11:22:33 -06:00
Seebs
d8b9a921b8 handle BitN when updating an existing bitmap pointer cell
We have code to correctly fill in cell.BitN when a leaf cell already
exists but isn't of the correct sort, but not to handle the case where
it already exists and *is* a BitmapPtr, but doesn't necessarily have
the right BitN value.
2022-03-07 09:16:16 -06:00
Travis Turner
30424499fa
Merge pull request #1813 from molecula/tlt/tx-comments
Clean up some of the go-doc entries in tx.go
2022-03-04 15:30:01 -06:00
Travis Turner
c4bc78bb36
Merge branch 'master' into tlt/tx-comments 2022-03-04 15:05:39 -06:00
seebs
aed3fc7fee
Merge pull request #1963 from molecula/fb1235
[FB-1235] Don't deadlock on multiple simultaneous CreateField
2022-03-04 11:20:21 -06:00
Seebs
9135b41ca8 test multiple field creations at once on a cluster
This test tries to verify that we can create multiple fields on a cluster
without deadlocking or getting errors *other than* ErrFieldExists or
wrappers of it. The "or wrappers of it" implies a change to ConflictError's
semantics, but honestly I think it should have had those semantics all along.
2022-03-04 10:21:18 -06:00
Seebs
bc6947a9ac try not to deadlock on simultaneous CreateField to two nodes in a cluster
Two CreateField messages reaching different nodes in a cluster at the same
time could cause a deadlock because each CreateField runs with a write lock
held, then issues requests to other nodes which, at a minimum, need
a read lock and which may require a write lock. Reorder things a bit to
make the broadcast to other nodes happen outside the lock. We may also
need to do something to have nodes handle the case where something's been
created in etcd but they haven't gotten the message about it yet.
2022-03-04 10:21:18 -06:00
Samir Patel
be5cffff32
Merge pull request #1964 from molecula/sql-where-testcases
[FB-1226 FB-1227] Add tests for sql WHERE clause with timestamps
2022-03-04 11:02:38 -05:00
Samir Patel
2ebb4d1865 add tests for sql WHERE clause with timestamps
Creates a timestamp field in the TestSQLQuery dataset.

Modifies a helper function to allow datasets with
timestamp to be properly converted to table responses.

Adds test cases for:
- conditional where clauses
- where clause with group by
- timestamp within where clause
- select distinct with where clause
2022-03-03 22:20:49 -06:00
Ben Johnson
32fb80960a
Merge pull request #1962 from molecula/fb-1237
[FB-1237] Revert auto-quoting in Web UI
2022-03-03 13:01:45 -07:00
Ben Johnson
d9ad819fe9 Revert auto-quoting in Web UI 2022-03-03 12:35:54 -07:00
Matthew Jaffee
b7469acb04
Merge pull request #1952 from molecula/1222-release-format
FB-1222 release format
2022-03-02 15:25:45 -06:00
Matthew Jaffee
3fc271ff07 change release format
This was in response to some feedback we got about the new release
format. Executables were no longer had executable permission due to
going through S3 (hence the tarballs), and we wanted a more consistent
directory structure in the final release which included the versions
of various components.
2022-03-02 14:39:41 -06:00
reesporte
2f6aed74e6
Merge pull request #1956 from molecula/fb-1127
remove /schema/details cardinality calculation, and schemaDetailsOn config option
2022-03-02 14:37:53 -06:00
reesporte
17203e3441 remove cardinality calculation from schema/details
this is related to work for [fb-1127](https://molecula.atlassian.net/browse/FB-1127)

cardinality reporting has caused no shortage of issues such that we recommend
disabling them almost everywhere.

this commit removes the cardinality calculation for right now, as well as the option
to enable/disable schema details.
2022-03-02 14:09:09 -06:00
Matthew Jaffee
239477c526
Merge pull request #1960 from molecula/race-tests-needs
add "needs: []" to go tests race to make overall pipeline faster
2022-03-02 10:40:27 -06:00
Matthew Jaffee
0dc5aed8d7 add "go mod tidy" CI check
pulled this from IDK... we just had an issue where we had an unused
dep in go.mod.
2022-03-02 08:47:12 -06:00
Matthew Jaffee
63c3a8b761 add "needs: []" to go tests race to make it start immediately
also move race tests to a special "nonblocking" stage that is after
everything else, so they don't block anything else from starting
2022-03-02 08:47:12 -06:00
Ben Johnson
d7ee20ca69
Merge pull request #1961 from molecula/fb-1227
[FB-1227] Enable WHERE clause for SELECT DISTINCT SQL queries
2022-03-01 16:07:37 -07:00
Ben Johnson
1222bf22cd Use Distinct() call for SQL DISTINCT 2022-03-01 15:04:32 -07:00
Ben Johnson
321c14880b
Merge pull request #1958 from molecula/fb-1226
[FB-1226] Enable multi-field WHERE clause for GROUP BY SQL queries
2022-03-01 15:04:20 -07:00
Ben Johnson
7ebc28a734
Merge branch 'master' into fb-1226 2022-03-01 12:09:57 -07:00
seebs
789fef7a8e
Merge pull request #1955 from molecula/fb1225
[FB-1225] don't look up a field by name to find out its name
2022-03-01 12:43:21 -06:00
Seebs
21a478a728 don't look up a field by name to find out its name
If a field doesn't exist, looking up that field produces a nil,
and querying the name of a nil field fails. Don't do that. Instead,
just use the name you're looking it up by.

We could in theory return an error here, but we already handle
nonexistent fields elsewhere and checking this when we already have
checks for it seems unnecessary, I think?

Also, we add a test for this. The test is over in server/grpc_test.go
because we have infrastructure there for testing the SQL server
functionality, and you can't actually write reasonable self-contained
tests for the SQL stuff because it has no way to create a working
server.
2022-03-01 11:49:42 -06:00
reesporte
87300e27f1
Merge pull request #1957 from molecula/tidy
go mod tidy
2022-03-01 11:45:37 -06:00
Ben Johnson
e69ad74532 Enable multi-field WHERE clause for GROUP BY SQL queries 2022-03-01 10:28:11 -07:00
reesporte
422f532b89 go mod tidy 2022-03-01 10:54:53 -06:00
reesporte
28af155411
Merge pull request #1951 from molecula/mem-endpoint
add get internal mem usage endpoint
2022-02-28 16:55:25 -06:00
reesporte
18bddca86f add get internal mem usage endpoint
for use in benchmarking deletes
2022-02-28 16:31:12 -06:00
reesporte
92aa99ffa9
Merge pull request #1949 from molecula/fb-1187
use free id bucket to re-use ids
2022-02-28 16:30:48 -06:00
reesporte
287332d820 use free id bucket to re-use ids
this way memory usage doesn't grow without bound when we have lots of deletes and
writes.

fixes [fb-1187](https://molecula.atlassian.net/browse/FB-1187)
2022-02-28 15:56:58 -06:00
seebs
78e55fe410
Merge pull request #1943 from molecula/fb1216
[FB-1216] Improve sum aggregate performance
2022-02-28 15:22:14 -06:00
Seebs
f5954d3cc6 use a pool for containerFilter objects
We create a lot of these during a large GroupBy query or anything else
that creates a ton of filters. Use a pool so we can reuse them, since
most of their data doesn't need to be zeroed out, and typical use
patterns have a lot of sequential creation of these short-lived things
within a goroutine.
2022-02-28 14:41:30 -06:00
Seebs
eb26a86518 implement a BSI-aware filter to avoid OffsetRange calls in fragment.sum
We don't really need to fully extract every row, we just need counts.
This naive approach uses logic similar to BitmapBitmapFilter, but tweaks
it so that we can intercept the existence and sign bit rows, work with
an optional filter, and yield a sum. We accumulate the statistics
internally, rather than using a callback, because I tried to make it
work with a callback and it was a complete mess.

Note the fancy check for container reuse in the BSI Count filter.
This is because intersection(full container, X) is just the original
X, *not* a copy, but in this case we need a copy because RBF
ApplyFilter will in fact reuse a single container's storage for
each consecutive container.
2022-02-28 14:41:30 -06:00
Seebs
67f2312150 trust cell.BitN now
We used to manually do this because we had a number of cases where
BitN wasn't being updated, but so far as we know we've fixed them
and we have run a fair amount of stuff with sanity checks on and
not hit anything, so eliminating the constant recounting on bitwise
containers seems like a win.
2022-02-28 14:41:30 -06:00
Ben Johnson
0e84a30469
Merge pull request #1934 from molecula/fb-1113
[FB-1113] Add test coverage for RBF deletion
2022-02-28 13:34:14 -07:00
Ben Johnson
6948b18052 Add test coverage for RBF deletion 2022-02-28 12:56:24 -07:00
Ben Johnson
0b5a0d449e
Merge pull request #1953 from molecula/sup-156
[SUP-156] Add SQL SELECT mapping test
2022-02-28 12:55:35 -07:00
Ben Johnson
0f70253cc0 Add SQL SELECT mapping test 2022-02-28 12:17:07 -07:00
reesporte
da3ce449ba
Merge pull request #1942 from molecula/fb-1127
rip out ui/usage
2022-02-28 13:16:29 -06:00
reesporte
241550c751 fix sonarcloud code smells 2022-02-28 12:05:44 -06:00
reesporte
248dc4fe85 rip out ui/usage
addresses concerns in [fb-1127](https://molecula.atlassian.net/browse/FB-1127)

TLDR;
/ui/usage was a hotbed for issues and SEs have been turning it off anyway for ages
2022-02-28 12:05:44 -06:00
seebs
2cbcc24639
Merge pull request #1928 from molecula/fb1211
[FB-1211] don't crash on close during reads
2022-02-28 11:52:31 -06:00
Seebs
7dd7557e21 don't dump stuff to stdout for tests
We have some tests that cover stuff like the DumpDot functionality,
but we don't need them to actually write to stdout during ordinary
testing. Dump to buffers which we politely ignore. Yes, we could have
used a dummy writer, but this way it's super easy to display the
contents if we find ourselves suddenly caring.
2022-02-28 11:15:52 -06:00
Seebs
3ced081271 prevent crashes when closing db
When closing, we need to wait for existing Tx to exit before truncating
files and unmapping things. This shouldn't matter, because we don't actually
close the DB until all transactions are done, normally... except for the
background usage-gathering task. But really, it's probably just better to
be conservative.

The actual logic is fancier than it looks. We can't hold db.mu.Lock during
this, or the existing Tx can't exit. So we first grab the lock, set the closed
flag, set up a waiter for all current Tx to exit, and then release the lock.
Now we wait on the current Tx exiting. Once that's done, we grab the locks.
Anything coming in that tries to start a Tx will fail out fairly quickly
because the opened flag is now false, so even if other things get those
locks before we do, they won't keep them or create new Tx.

This makes one test deadlock because it opens a Tx and never closes it,
so we change that test to close its Tx.
2022-02-28 11:15:32 -06:00
Seebs
5901bcd5d6 drop unused helper functions
I have no idea what these functions were for, but we aren't using them
so let's not have them.
2022-02-28 11:14:22 -06:00
tgruben
39903bc17e
Merge pull request #1939 from molecula/FB-1185
[FB-1185] remove string keys on delete to allow for reuse
2022-02-28 10:46:21 -06:00
tgruben
53e3ac3e38
Merge branch 'master' into FB-1185 2022-02-28 10:20:30 -06:00
pokeeffe-molecula
9cfa557bc7
Merge pull request #1946 from molecula/able-perf
only run able perf on master
2022-02-28 10:01:08 -06:00
pokeeffe-molecula
01f27fb743
Merge branch 'master' into able-perf 2022-02-28 09:44:09 -06:00