Commit graph

9174 commits

Author SHA1 Message Date
tgruben
4a155eba88
Merge pull request #2014 from molecula/expose-etcd-ttl
[FB-1347] expose etcd ttl timeout period
2022-04-11 10:33:20 -05:00
tgruben
45d4d0bcfd
Merge branch 'master' into expose-etcd-ttl 2022-04-11 09:51:59 -05:00
seebs
8284306d5f
Merge pull request #2009 from molecula/fb1342
[FB-1342] handle time quantums better in GroupBy
2022-04-11 09:47:19 -05:00
Todd Gruben
74ab06f5d3 expose etcd ttl timeout period 2022-04-11 08:58:39 -05:00
Seebs
9f2b888c4f standardize and correct time range handling
If you're wondering how something that simple gets a commit
message this long, sit down, because you are in for a ride.

The Row, Rows, TopK, and GroupBy(Rows...) commands had three
different sets of semantics for from/to ranges. We unify these.
Sounds easy, right?

The original purpose of this was to address a bug in GroupBy
where, if you had multiple queries only one of which used time,
we could end up silently returning no results because we tried to
do a time query against a non-time field. This was easy to
fix; just move a boolean flag from outside a loop to inside
the loop so it resets to false on each pass.

In the process of trying to test that, I discovered that
specifying `from=...` without `to=...` in a Rows in a GroupBy
didn't work. Searching around, I discovered that we had three
different answers:

	GroupBy, TopK: unspecified 'to=' is 0
	Row: unspecified to is tomorrow
	Rows: unspecified to is the max time quantum in the field

(A time value of 0 is apparently interpreted as January 1st,
0001.) Note that "GroupBy" is really referring to a Rows()
command in a GroupBy, it's just that this uses completely different
code (because it has to be computing rows potentially matching or
restricted to a filter, or provide the rows it generated so
they can be used to filter something else).

So we fixed that, and made a field method for finding the min/max
values (as done in a Rows command that *isn't* in a GroupBy),
and tried to use that with viewsByTimeRange. Then I tried to write
documentation for this, but the documentation was unclear, and
I tried to clear it up. Which caused me to discover that these
four different places ALSO differed in when or whether they'd
replace a broad query with "just the standard view".

So. Round two of the fix: We create a `field.viewsByTimeRange`,
which tries to fall back to a standard view when one exists
and the specified range covers everything, and treats zero
values as non-restrictive, but also picks a narrow range that
is actually related to the range of dates in the field. This
matters because viewsByTimeRange generates the entire set of
views it would need *even if those views don't exist*.

We drop one test that was testing Rows specifically to verify
that, if you omitted To, we acted as though you'd specified a date
two days in the future. That behavior is not now intended, so
we drop the test that tries to verify it.

Thing that might make this better: Figuring out a way to generate the
list of views more cheaply. Right now, we're redoing all the view
computation, including producing a sorted list of view names, for
every shard. This is excessive, but hard to fix.

In particular, there is no trivial way to generate a sorting such
that you can take slices of it and have them be the right slices,
because we want to skip smaller time quanta when an entire larger
parent quantum is included. e.g., if we're including all of
April 2022, we don't want to include any of the days for April of
2022, but if we're doing up through April 15th, we want to include
the first 15 days of April, but NOT include the whole-month quantum.
And so on. Fixing this cleanly is hard and would require a
significant design effort.
2022-04-08 14:19:36 -05:00
Kasey C. Rodgers
aaa7051c21
Merge pull request #2013 from molecula/fb1309
fix the spots where gitlab thinks we're using hard-coded passwords
2022-04-08 12:35:52 -04:00
Kasey C. Rodgers
d47f3975c9
Merge branch 'master' into fb1309 2022-04-08 09:02:42 -07:00
kcrodgers24
3816a7fad4 fix the spots where gitlab thinks we're using hard-coded passwords 2022-04-07 12:22:45 -04:00
Ben Johnson
1cc606f1e3
Merge pull request #1998 from molecula/fb-1291
[FB-1291] Allow fsync() to be disabled on RBF WAL only
2022-04-07 10:22:15 -06:00
Ben Johnson
130f3bb10a
Merge branch 'master' into fb-1291 2022-04-07 09:16:29 -06:00
reesporte
8fc70e6494
Merge pull request #2008 from molecula/FB-1332
Timestamp FieldOptions should include Min and Max when marshalled to …
2022-04-06 16:54:52 -05:00
reesporte
77568762c2 Timestamp FieldOptions should include Min and Max when marshalled to JSON
When you backup a cluster, we call /schema which marshals timestamp field options to
json, and restores the fields with those options. If the min and max are missing,
they are set to 0 on restore, which causes an issue on subsequent ingest.

Fixes [SUP-213](https://molecula.atlassian.net/browse/SUP-213) and
[FB-1332](https://molecula.atlassian.net/browse/FB-1332)
2022-04-06 16:29:24 -05:00
Ben Johnson
c06293052d
Merge branch 'master' into fb-1291 2022-04-06 12:24:54 -06:00
reesporte
f93b4b7878
Merge pull request #2007 from molecula/fb-1234-integration-test
Fb 1234 integration test
2022-04-05 15:21:53 -05:00
reesporte
29c339ced6 make the test a gauntlet test, uncomment all the others
Co-authored-by: tgruben <tgruben@gmail.com>
2022-04-05 15:00:32 -05:00
reesporte
c61d565b3c integration test for backup restore sev 2!
Co-authored-by: tgruben <tgruben@gmail.com>
2022-04-05 14:59:50 -05:00
reesporte
44dac583eb
Merge pull request #2005 from molecula/fb-1324
[FB-1324]: TranslateData should only redirect to an up node
2022-04-04 16:01:57 -05:00
reesporte
dbc3159e2c TranslateData should only redirect to an up node
During backups on a multi-node cluster, TranslateData was unconditionally redirecting to the primary, regardless of the primary’s status. This is less than ideal. If the primary is down, the backup will fail.

As a consequence of this fix, we will also no longer needlessly redirect to ourselves on a single node cluster. This is a great optimization win!!!!

Fixes # FB-1324 SUP-209

Co-authored-by: tgruben <tgruben@gmail.com>
2022-04-04 15:38:47 -05:00
seebs
e379ae5a36
Merge pull request #2003 from molecula/fb1306
[FB-1306] ingest API delete could deadlock
2022-04-04 11:38:08 -05:00
Seebs
28c2ccf074 allow ingest API delete to work at all, add test for it
The ingest API tried to do a Qcx operation that needs a write Tx after
requesting a write Tx. This doesn't work. The ingest API is the only caller
of clearExistenceColumns, so it's easy to just make it work for a given
shard using a provided Tx. This isn't especially clean, but a lot of this
is due for an overhaul anyway because the Qcx/Tx stuff is sort of broken.

Also, add any test case at all for this, since we didn't have one, and
also fix the fact that the test case failed because the test harness
didn't allow empty result sets.
2022-04-01 09:48:51 -05:00
reesporte
8230d53714
Merge pull request #2002 from molecula/fb-1305
refactor AddAuthToken to fallback to userinfo
2022-04-01 09:12:03 -05:00
reesporte
f529e723e7 refactor AddAuthToken to fallback to userinfo
This commit addresses a bug in https://molecula.atlassian.net/browse/SUP-200 where
the Authorization header was not being set correctly when the token was passed via
"userinfo" in the context and not "token".

Now, we prefix the token with "Bearer " when the token comes from userinfo.

This commit also adds a unit test for this function, and simplifies logic. It also
fixes a test that didn't quite test the behavior we wanted.
2022-03-30 16:52:24 -05:00
reesporte
23d8282663
Merge pull request #2000 from molecula/badge-time
add coverage, code quality badges
2022-03-30 10:34:55 -05:00
reesporte
efc21595c1 add coverage, code quality badges 2022-03-30 10:07:23 -05:00
tgruben
eb7c67e5fc
Merge pull request #1997 from molecula/bad-delete-bandaid
[FB-1290] revert async remove channel
2022-03-29 16:07:12 -05:00
Todd Gruben
2ac360734e remove RemoveChannel 2022-03-29 13:42:20 -05:00
Ben Johnson
c4e6a6ce8a Allow fsync() to be disabled on RBF WAL only 2022-03-25 15:16:41 -06:00
Todd Gruben
9e3a2bba15 revert remove channel 2022-03-25 15:50:54 -05:00
reesporte
a23c820e12
Merge pull request #1995 from molecula/sup-194
FB-1287 - fix viewTimePart to account for bad strings
2022-03-25 11:53:14 -05:00
reesporte
5946a12ab9 fix viewTimePart to account for bad strings
this stems from https://molecula.atlassian.net/browse/SUP-194 where the string
"standard" was being passed to viewTimePart, which output "standard" as the result.
this is not a valid time string and was causing confusing errors. now it simply
doesn't do that

this commit also adds regression testing framework and a regression test for fb-1287
2022-03-25 11:27:39 -05:00
Matthew Jaffee
f23d30deb4
Merge pull request #1996 from molecula/fb-1281
[FB-1281] Add regression test for delete with invalid bitmap panic
2022-03-24 16:44:56 -05:00
Ben Johnson
7aff965a28 Add regression test for FB-1281 2022-03-24 15:20:57 -06:00
Matthew Jaffee
1f147f3c8c
Merge pull request #1994 from molecula/fb-1270-repro
add reproducer for FB-1270 into smoke tests
2022-03-24 13:57:58 -05:00
Matthew Jaffee
bb637131b9 delete query was syntactically broken and unecessary
the issue reproduced even though this query was broken, so it can be removed.
2022-03-24 13:33:11 -05:00
Matthew Jaffee
b08389e0ed add reproducer for FB-1270 into smoke tests 2022-03-24 12:58:25 -05:00
Ben Johnson
cc86d9ba19
Merge pull request #1993 from molecula/sup-193
Clear page from RBF dirty cache on free.
2022-03-24 11:42:53 -06:00
Ben Johnson
331bf5567b
Merge branch 'master' into sup-193 2022-03-24 10:58:11 -06:00
Samir Patel
4843030a8b
Merge pull request #1992 from molecula/fb-1274
[FB-1274] Allow empty values to be provided for vars in Row call
2022-03-24 12:20:48 -04:00
Samir Patel
8da946fe9b allow empty values to be provided for vars in Row call
queries can become arbitrarily long when variables are used.
This is especially the case when a variable is defined as
'select distinct field from table'
and a user wants to use all the values in a Row call
(which is effectively disabling any condition on the field).

This change allows users to select no values for a variable
associated with a Row call to disable the condition. If that
variable is the only condition (query expands to nothing)
then it interprets it as an All call.
2022-03-24 10:45:30 -05:00
Ben Johnson
52ab38d50d Clear page from RBF dirty cache on free. 2022-03-24 09:12:15 -06:00
reesporte
29754b53b6
Merge pull request #1991 from molecula/authclustertest-fix
use the env var for project
2022-03-24 09:35:20 -05:00
reesporte
e4e24baa43 use the env var for project 2022-03-23 08:55:23 -05:00
rachithrr
1230e4127c
Merge pull request #1990 from molecula/FB-1281
FB-1281: FeatureBase crashes when Row call with "==" in Delete
2022-03-21 16:49:09 -05:00
rachithrr
cc4dcce181
Merge branch 'master' into FB-1281 2022-03-21 15:48:16 -05:00
rachithrr
d7c561aa7d FB-1281: FeatureBase crashes when Row call with "==" in Delete
- the EQ goes through HasConditionArg(), but the error wasn't caught
in the case of Delete.
2022-03-21 15:40:39 -05:00
seebs
bac3360fa3
Merge pull request #1989 from molecula/fb1266
[FB-1266] prevent concurrent map writes in openField
2022-03-21 15:10:32 -05:00
Seebs
70760b187f prevent concurrent map writes in openField
Prior to this, we locked the index-wide i.mu around writes to i.fields.
But now the entire open process is holding that lock, so we couldn't
lock it here (that'd deadlock) and didn't think we needed to (because
it was held). But in fact that means that multiple fields being opened
at once can concurrently write to the map. Conveniently, we *already*
pass a shared mutex into openField() to prevent exactly this sort of
problem; we just need to actually use it when doing the write.
2022-03-21 14:34:39 -05:00
Kasey C. Rodgers
a9b56b055e
Merge pull request #1988 from molecula/fb-1277-go1.17.8
build with Go 1.17.8 to avoid vulnerability in 1.17.7
2022-03-21 12:32:17 -07:00
Matthew Jaffee
3c98f1dfb1 build with Go 1.17.8 to avoid vulnerability in 1.17.7 2022-03-21 13:53:00 -05:00
seebs
7f19c5cec7
Merge pull request #1985 from molecula/fb1266
[FB-1266] track closing status for index/field/view, shut down cache flush early
2022-03-21 12:23:44 -05:00