Commit graph

9234 commits

Author SHA1 Message Date
Samir Patel
68e72c2ce0
[FB-1435] BSI Base Fix (#2056)
* add bsi base back to int value

* test bsi base/min/max for IntFields

motivated by bsi base not being added back to values
in extract calls when min was a positive integer.
2022-05-13 09:33:53 -04:00
tgruben
09b4eed348
[FB-1388] Add optional support for continuous profiling in datadog (#2037)
Enable ability to use DataDog continuous profiling
2022-05-12 12:33:46 -05:00
hphamMolecula
94e772e6ec
FB-1403 - TTL - Added check for upper bound date (#2053)
* FB-1403 - TTL - Changed TTL to check for the end date of view time

* FB-1403 - TTL - clean up unit tests
2022-05-11 13:57:29 -05:00
tgruben
dd139cd48d
[FB-1398] Mainline etcd (#2049)
* use mainline etcd-io dependencies, not forks

this commit does lots of things around clustering with goal of increasing stability.

- upgrades from molecula/etcd to go.etcd.io/etcd@v3.5.4
- upgrades from seebs/bbolt to go.etcd.io/bbolt@v1.3.6
- update tests to use unix sockets for etcd cluster communication
    - this is what etcd uses for a lot of internal testing, so if their devs think
      it's a valid test, we can probably accept that
- cleanup etcd node-watcher shutdown process

Co-authored-by: tgruben <tgruben@gmail.com>

* moved random query to another repo

it had weird dependency issues with upgrading to mainline etcd bc of the vegeta dep
so we removed it bc no one really uses it anyway

we got this error message:
```
github.com/molecula/featurebase/v3/cmd/random-query imports
	github.com/tsenart/vegeta/v12/lib tested by
	github.com/tsenart/vegeta/v12/lib.test imports
	github.com/streadway/quantile tested by
	github.com/streadway/quantile.test imports
	.: "." is relative, but relative import paths are not supported in module mode
```

* add cleanup to EtcdUnixSocket test util

Co-authored-by: reesporte <reesedporter@gmail.com>
2022-05-11 09:49:48 -05:00
souhailanoor
ffed9531fc
FB-1253: Fixes for scheduled test (#2048)
* fix for changes in utilCluster

* fixes for samsung and backup-restore gauntlets
2022-05-06 12:00:04 -05:00
souhailanoor
b82375bca2
Tremor delete test scripts (#1974)
- terraform scripts to set up cluster
- cloud-formation scripts to set up cluster
- set up ingest node with kafka server and datagen
- set up second ingest node with molecula-consumer-kafka-static
- set up datadog in all nodes (ingest + featurebase)
- set up script to execute different queries
- only run delete test on schedule
2022-05-05 10:25:35 -05:00
Matthew Jaffee
a093099a8c dont default to standard view for some time range queries
previously, we would use the standard view if the query seemed to
cover all the views we had, or if we didn't seem to have any time
views. This is unintuitive if some views have been deleted (which
comes up a lot more often with TTL!). It's also unintuitive if you
know you haven't set any data w/ a timestamp and your query that
specifies a time range returns any data.
2022-05-04 11:04:38 -05:00
Matthew Jaffee
0d50bd2890 implement ability to update TTL on time fields 2022-05-04 11:04:38 -05:00
Matthew Jaffee
e0e01f9f65 expose --header-timeout option on featurebase backup 2022-04-29 16:37:40 -05:00
Matthew Jaffee
c554adb70a convert executor.shutdown to channel to avoid data race
Here was the race:
https://gitlab.com/molecula/featurebase/-/jobs/2391959728
2022-04-28 14:09:32 -05:00
Matthew Jaffee
cb4f23fc98 translate data: only redirect to UNKNOWN node if there is no STARTED
caveat: this will always redirect to the first UNKNOWN
node... possibly we would want to select randomly or have the ability
to retry different nodes.
2022-04-28 14:09:32 -05:00
Matthew Jaffee
f7651e3a26 update tests to reflect recent changes around allowing things when
nodes are UNKNOWN
2022-04-28 14:09:32 -05:00
Matthew Jaffee
364888086b allow reading translation from nodes in UNKNOWN state 2022-04-28 14:09:32 -05:00
Matthew Jaffee
02663d0282 when calculating what nodes can process a shard allow UNKNOWN state
we have an issue where nodes get into UNKNOWN state rather frequently
during periods of high load when they aren't actually down. We want to
allow queries in this situation rather than giving a "shard
unavailable" message.
2022-04-28 14:09:32 -05:00
Matthew Jaffee
dee46d4423 add PartitionToNodeAssignment as a new option
We default to the jmp-hash method which we had previously, and allow a
user to set the "modulus" option which uses a simple mod operation to
ensure an even spread of partitions across nodes.

I think that ideally we would have new indexes uses modulus and
existing indexes use jmp-hash which implies supporting this
configuration on a per-index basis.

If we don't do per index, we should probably run the whole test suite
both ways.
2022-04-27 17:21:47 -05:00
Matthew Jaffee
24af93e7d8 change assignment of partitions to nodes
we change this to use a simple modulus to ensure maximally even
assignment of partitions to nodes rather than the hash thing we were
doing previously which may have helped minimize data movement when
adding nodes, though I'm not even sure of that.

The logic was duplicated in a few places, so we've also condensed
that. For now, we're skipping tests which have baked in assumptions
about which node a partition will end up on as we expect them to fail
until they are updated.
2022-04-27 17:21:47 -05:00
Travis Turner
7ccc845aac
Change Ttl to TTL (#2038)
* Change Ttl to TTL

Following go convention, acronyms should have a consistent case.
See
[Initialisms](https://github.com/golang/go/wiki/CodeReviewComments#initialisms)

This commit changes some public-facing methods, so any code importing
this package and using these methods will need to be updated.

* rewrite Ttl -> TTL

Co-authored-by: reesporte <reesedporter@gmail.com>
2022-04-27 11:20:39 -05:00
rachithrr
eba7927b56
FB-1387: Grafana Empty Variable Select (#2032)
Fixed the issue where deselecting variables didn't work on quries like
groupby and extract.
The empty variables list returns All() when the variables are empty.
2022-04-26 12:39:28 -05:00
reesporte
0e37e04f47
check for context deadline exceeded in retry client (#2033)
you can get a context deadline exceeded from clientv3 if there's heavy load and the
etcd server sends a grpc code DeadlineExceeded. this causes the etcd client to not
retry connecting and then you end up with nodes that can't recover.

Co-authored-by: tgruben <tgruben@gmail.com>
Co-authored-by: 54mir <48686912+54mir@users.noreply.github.com>
Co-authored-by: seebs <seebs@molecula.com>

Co-authored-by: tgruben <tgruben@gmail.com>
Co-authored-by: 54mir <48686912+54mir@users.noreply.github.com>
Co-authored-by: seebs <seebs@molecula.com>
2022-04-25 14:23:27 -05:00
Ben Johnson
8702fac11d
Improve RBF documentation (#2034) 2022-04-25 09:13:54 -05:00
Bruce Baranowski
19613a3048
Mitigate 1 instance of potential integer overflow 2022-04-19 11:06:25 -04:00
reesporte
a8c1b93610
Add Max(timestamp) tests to smoke-test (#2025)
* Add Max(timestamp) tests to smoke-test

run a Max() call on a timestamp field twice, and make sure the results are the same

* chmod +x
2022-04-18 15:33:20 -05:00
reesporte
03df1ba6ad
remove trailing spaces en masse (#2024) 2022-04-18 09:31:35 -05:00
reesporte
e2bf96731f
Merge pull request #2015 from molecula/union-distinct-ts-better
save space when union-ing DistinctTimestamps
2022-04-14 11:11:36 -05:00
reesporte
96df2700fd save space when union-ing DistinctTimestamps
By using an empty struct, we reduce memory usage by
up to 16 bytes (the size of a timestamp string)
2022-04-14 10:31:56 -05:00
reesporte
f5c3c44411
Merge pull request #2019 from molecula/sup-218
[SUP-218, FB-1356] Pass auth info through context as needed, setup auth smoke testing infrastructure
2022-04-14 10:07:54 -05:00
reesporte
f224e64bc3 setup auth cluster infra
also add test for sup218

Co-authored-by: rachithrr <rachith.ramaswamy@molecula.com>
Co-authored-by: bruce-b-molecula <bruce.baranowski@molecula.com>
2022-04-14 09:37:52 -05:00
reesporte
ea33a2b976 fix broken test 2022-04-14 09:37:33 -05:00
reesporte
1060520fa7 add better error messaging for if the test is empty 2022-04-14 09:37:33 -05:00
reesporte
bff9128c9b properly thread the ctx through so we can pass Auth around 2022-04-14 09:37:32 -05:00
seebs
e530193e80
Merge pull request #2017 from molecula/fb1358
[FB-1358] gracefully handle invalid indexes in joins
2022-04-13 12:48:36 -05:00
Seebs
727c2ed724 gracefully handle invalid indexes in joins
If a join is requested against an index that doesn't exist, we
should report that as an error rather than panicing.
2022-04-13 11:44:58 -05:00
tgruben
bfde4860c1
Merge pull request #2018 from molecula/fix-bad-defaults
[FB-1360] apply sane numbers when min/max 0 is provided
2022-04-12 16:15:11 -05:00
Todd Gruben
7588912c19 apply sane numbers when min/max 0 is provided 2022-04-12 15:47:14 -05:00
seebs
54a8754c33
Merge pull request #2001 from molecula/fb1290
[FB-1290] ApplyRewriter and friends
2022-04-12 14:35:22 -05:00
Seebs
cb99f88527 ClearRecords API change 2022-04-12 13:15:15 -05:00
Seebs
5d1db3a4f2 handle dirty correctly even if a page split happens 2022-04-12 13:04:55 -05:00
Seebs
6e90bfc9bc return early rather than just evaluating a rejection
The intent of these lines was "if there's no filter, return
immediately rather than doing operations".

But actually we didn't write that, so we were calling intersectionCallback
on empty filters, which didn't matter since it failed out quickly, but
it's still a waste of effort.

Except we shouldn't get to these anyway because ConsiderKey already
correctly rejected these cases. I think. But still.
2022-04-12 12:24:22 -05:00
Seebs
16fef7ffbd re-add the nextOffsets logic to BitmapBitmapTrimmer
In fact, we *do* want to skip ahead sometimes to the next thing, and
only call our callback for things that match our filter. I was thinking
that we needed to call the callback for all data regardless, because
what if you're writing to a mutex and adding new data.

But even if you're adding new data, it's still in the filter, because
it has to be, because we don't start out knowing there's no existing
data. So the mutex actually works fine.

So the rule for BitmapBitmapTrimmer is that your filter doesn't have
any meaning other than (1) it tells us which containers you need
to see, (2) we provide it to your callback function. Maybe you want
to subtract those. Maybe you want to add them. That's up to you to
decide.
2022-04-12 12:24:22 -05:00
Seebs
88a6a047d2 try to reduce seeking in ApplyRewriter a little
Slightly more careful thoughts about whether or not the cursor
is "dirty".
2022-04-12 12:24:22 -05:00
Seebs
919eb3f0e8 rework bulkImportMutex to use ApplyRewriter
Now that we have ApplyRewriter, it's a viable way to implement ImportMutex.
It can be slower on low-density writes, because it's checking more things
than it otherwise might -- the other filter form can skip ahead and only
check the containers it's modfying, in principle, while this one doesn't
know it can do that. (The decision as to how far to skip ahead has to
be made in the BitmapBitmapTrimmer, while it's the callback provided to
it that knows when it next has data to write.)

On the other hand, it's probably faster in some cases, and would be
more-faster if we could improve the cursor management a bit, and it's
skipping at least some seeking because it doesn't need to use
ImportPositions after reading the whole thing.
2022-04-12 12:24:22 -05:00
Seebs
852a8be45a use ApplyRewriter for ClearRecords
This uses the shiny new ApplyRewriter logic for ClearRecords,
mostly to verify that ApplyRewriter works at all.

This also implies separating the cache update code out from
importPositions so it can be used also by this.

We also use fragment.ClearRecords instead of the different clearFragment
code in executor.  The clearFragment implementation did not update TopN
caches and the like. Standardize it on the clearRecords implementation
which does.
2022-04-12 12:24:22 -05:00
Seebs
74ae1fd598 export and improve DifferenceInPlace
We don't need to manually copy each individual item and keep
checking for the second index being out of bounds for every
item, we know it can't change at this point, so we can just bump
it over. We want this operation because BitmapRewriter can
use it to simplify trimming in some cases.
2022-04-12 12:24:22 -05:00
Seebs
5148974602 trust cell.BitN a few more places
Found a couple of places where we were still not trusting this, but really
we're testing it a lot more carefully now.
2022-04-12 12:24:22 -05:00
Seebs
9acc7a6019 Drop unneeded locks
The filter and rewrite logic are unlocking and relocking but I don't
think they should. I think those locks were added early on during
testing of the filter stuff, but I don't think they should be needed,
and I've been unable to find a case where they were. I think probably
I had something where a ConsiderData function was trying to run a Tx.
2022-04-12 12:24:22 -05:00
Seebs
e67beb8766 create BitmapRewriter/ApplyRewriter, parallel to BitmapFilter
This in a parallel to ApplyFilter/BitmapFilter which allows writebacks
while it's running. It's a write operation, so it needs a write lock
on the Tx, and needs to create bitmaps if they don't already exist.
The semantics are a bit messy and need better documentation still.
2022-04-12 12:24:22 -05:00
Seebs
d972028858 implement RemakeContainerFrom and helper function for it
We frequently want to grab the set of values from a []uint64
that correspond to a given key, and make a container from them, but
sometimes we only want to do one of these. This implementation
lets us do that the same way every time, and do in-place
container creation without extra allocs.
2022-04-12 12:24:22 -05:00
Seebs
86088fd688 drop incorrect test
The test for bitmap-to-array succeeding doesn't work with roaringParanoia,
which *does* intentionally panic at that point. Possibly we should also
drop the corresponding logic that tries to prevent it from panicing,
since it won't work with the paranoia flag on anyway.
2022-04-12 12:24:22 -05:00
Ben Johnson
11a5178471
Merge pull request #2010 from molecula/fb-1229
[FB-1229] Shrink RBF freelist & truncate data file on checkpoint
2022-04-12 08:33:28 -06:00
Ben Johnson
7f05dc5848
Merge branch 'master' into fb-1229 2022-04-11 14:00:37 -06:00