Commit graph

9308 commits

Author SHA1 Message Date
tgruben
e9fce90e26
[FB-1587] crash would occur if missing nil-entry in batch (#2145)
* crash would occur if missing nilentry in batch

* Update client/batch.go

Co-authored-by: reesporte <45641995+reesporte@users.noreply.github.com>

Co-authored-by: reesporte <45641995+reesporte@users.noreply.github.com>
2022-07-12 17:20:55 -05:00
Samir Patel
6c0c8ffe09
upgrade ci-lint to 1.46.2 (#2143) 2022-07-07 11:18:41 -05:00
Hoang Pham
c0d630bee2 FB-1505 - check if view 'standard' exists 2022-06-30 16:58:57 -05:00
Hoang Pham
51ca8a131b FB-1505: catch ErrInvalidView for when multiple data nodes are trying to delete the same view 2022-06-30 16:58:57 -05:00
Hoang Pham
d807071a17 FB-1505 - Fixed for PR: renamed monitorTTL to monitorViewsRemoval 2022-06-30 16:58:57 -05:00
Hoang Pham
367448b034 FB-1505 - Fixes for PR: remove underscores from test names, rename TTLRemoval to ViewsRemoval 2022-06-30 16:58:57 -05:00
Hoang Pham
106c043f57 FB-1505 - added ability to update NoStandardView and delete standard view 2022-06-30 16:58:57 -05:00
souhailanoor
91e59e4376
Create a pool of goroutines bounded to hardware limits. This should resolve "connection refused" error from spawning too many goroutines at once. (#2138) 2022-06-29 16:22:37 -05:00
Kasey C. Rodgers
aaad12ed5b
sonarcloud ignore fix (#2137)
Co-authored-by: Kasey Rodgers <kasey.rodgers@molecula.com>
2022-06-29 12:36:44 -07:00
Matthew Jaffee
13b93d7795
add logging on error on DeleteFragmentFromStore in TTLRemoval loop (#2134) 2022-06-29 10:42:42 -05:00
reesporte
6afd9202bd add guardrails to TLS configs
We catch some possible states that don't make sense or are insecure:
1. If we're passed a nil tlsConfig to parse, return an error so we don't panic.
2. If we have a root CA, but we're skipping server cert verification, return an error.
3. If we have a TLS cert, but we're skipping server cert verification, return an error.
2022-06-28 11:58:19 -05:00
reesporte
edc7a9822f delete things from holder after removal from etcd
This way we can't get into an inconsistent state.

Consider this example:
You have a 3-node cluster, nodes A, B and C.
You create an index "blah" while all three nodes are up.
Nodes B and C go down.
You attempt to delete the index. It is removed from node A's holder, but is not removed from nodes B and C.
When nodes B and C are restarted, the schema still shows this "blah" index.
If you attempt to delete the index from node A, you receive an index not found error, but the schema indicates the index exists.

With this change however, when you first attempt to delete the index, it is not removed from the holder until there is enough nodes up to achieve consensus.

The same situation applies to fields and views.
2022-06-23 14:03:52 -05:00
Matthew Jaffee
bfa59ffdc4 fix container key computation for UnionRows call 2022-06-23 08:12:31 -05:00
Seebs
97c84da566 fix race condition in executor shutdown 2022-06-21 17:03:09 -05:00
Seebs
fd9d4de31d Remove most of the resize-related logic
We had two different, incompatible-with-each-other, and both
individually broken, partial implementations of resizing logic.
There's the original pre-etcd resize, and then the etcd resize,
and neither works, but there's conflicts between the ways they
don't work.

No attempt to fix this is likely to yield decent results, so
instead, we yank them both out entirely, so if we decide to
implement resizing (which we will) we won't be confused by
stray code pertaining to resizing that's not really hooked
up to anything.

We're leaving the resize messages in protobuf to avoid renumbering
protobuf messages. We rename some of our message types to UNUSED0,
etcetera, so that any code still using the old names won't
compile, to make sure we get rid of it, but we can't just drop
the numbers without breaking rolling restart.

The Resize_AddNode tests are removed not just because we don't
have resizing, but because they were completely broken anyway
and never worked at all. But there's no reason to fix them because
they exist to fix the functionality we didn't have and are now
removing the vestigial remains of.

We also drop the one usage of the AddNode function of Noder, because
it was used only by one test code fragment that was creatincg clusters,
and that can be done more correctly. There were no other call sites
at all.

We mark the monitorAntiEntropy function to be ignored by
code coverage because it's not actually being covered. There's
a separate ticket for removing that entirely.
2022-06-21 17:03:09 -05:00
Samir Patel
c04fd9734e
Add proper version info to sentry logs 2022-06-21 11:03:22 -05:00
reesporte
f3f1ea41b7 indicate sign with a bool 2022-06-17 14:58:30 -05:00
reesporte
51fb34e657 make Decimal proto definition backwards compatible 2022-06-17 14:58:30 -05:00
reesporte
0d91e2991d Revert "FB-1491: Revert pql.Decimal commit for the 4.8.5 release (#2117)"
This reverts commit acbcec54c8.
2022-06-17 14:58:30 -05:00
Samir Patel
f08d3e2834
fix parens around where clause bug (#2121)
Bug: if a sql query had a where clause within parens, the entire
clause would be ignored; and instead of it translating to a pql
intersection, it would become an All().

This occured b/c the parser library mapped such an expresstion to
a sqlparser.ParenExpr, and we did not have this as a condition in
a type switch.

So instead of treating a ParenExpr as nothing, we now recurse into
it.
2022-06-16 22:21:24 -05:00
Seebs
c0b26d5b69 improve sonarcloud coverage testing behavior
The sonarcloud job was accidentally altered to use *only* the PLG
coverage data, which is incomplete for reasons not yet fully
understood. Unfortunately, it wasn't *waiting* for the PLG coverage
data to be complete -- the job could start before the PLG coverage
ran, which mean that you could get anywhere from a few percent
to nearly total code coverage.

Also, we want to be sure to cover *both* the PLG and non-PLG coverage
data, so we add the non-PLG coverage data.

We also factor out the simulacraData package from our PKG_LIST because
it appears to be confusing sonarcloud because that package isn't
"included in project" or something.

Also remove a stray `ls` that was probably part of the original
testing/debugging of this.
2022-06-16 11:02:26 -05:00
rachithrr
acbcec54c8
FB-1491: Revert pql.Decimal commit for the 4.8.5 release (#2117)
* Revert "make pql.Decimal.Value a private big.Int field"

This reverts commit eab6174388.

* Revert "pql.Decimal for DecimalVal in ValCount&GroupCount"

This reverts commit a0c9eec410.

* Revert "Add AddDecimal support to pql"

This reverts commit 50787fd37a.
2022-06-15 09:15:37 -07:00
seebs
42b4c05df2
Implement UnionRows as a BitmapFilter (#2116)
This is fairly experimental, but basically, we make a fragment-level
op which, given a []uint64, can produce a union of all those rows in
the fragment, with a single scan through the fragment and not needing
a ton of additional space to reify all the rows at once.

Now with the Repair calls happening in the Results assembly rather than
on the intermediate data.
2022-06-15 08:40:12 -07:00
Samir Patel
0d43be934e
[FB-1479] Adds GRPC interceptor for sentry and chaining mechanism
also adds metadata for sentry performance monitoring for more organized output
2022-06-15 09:26:58 -05:00
Bruce Baranowski
b7516eacc5
CICD: fix Cleanup_Build_Job inconsistent failures (#2098)
* add aws profile to cleanup job

* Split cleanup into bash script

* change spot instances to one-tme
2022-06-14 11:49:25 -04:00
reesporte
9e17579a76 don't panic on nil field during inner join
when running a select statement with an inner join where the secondary field is non-existent, we get a panic. this commit fixes that.

see [fb-766](https://molecula.atlassian.net/browse/FB-766) for more information.
2022-06-14 10:01:16 -05:00
Matthew Jaffee
630d510f85 add a couple more tests cases, refactor to table driven
this was some quick work I did in response to a possible issue that
was reported. It didn't turn out to be a problem on our end and these
tests confirmed that, but I think this is worth checking in.
2022-06-13 13:48:24 -05:00
Kasey C. Rodgers
724863bb1b
Fb 1483 plg release (#2108)
* automate builds of single node featurebase for PLG

* make plg target uses go build instead of go install

* corrected artifact names in plg build stages

* add s3 dump for plg

* edits to s3 dump for plg
2022-06-10 15:07:36 -07:00
reesporte
a97c877f86 avoid out-of-bounds panic in rbf
We've seen this happen with relatively large datasets with a relatively low
max-file-size. The solution we came up with was to increase the max-file-size
config option, which works, but we still don't want there to be a panic if we
hit this again.

see https://molecula.atlassian.net/browse/FB-1381 for more information.
2022-06-10 15:29:06 -05:00
Samir Patel
5b11f3b3b1
[FB-1484] Sentry: fix middleware and CI test for PLG
* create getter for monitor state

* refactor monitor

* fix http middleware

* change warn to error if attmpt to cluster on plg

* sentry: special considerations if execution is part of test

- skip test if they build a cluster as this will error by design
- skip sending messages to sentry if testing
2022-06-10 14:52:32 -05:00
reesporte
821c6bd2ec we don't need _keys fields when we're migrating
https://molecula.atlassian.net/browse/FB-1085
2022-06-10 10:00:32 -05:00
Kasey C. Rodgers
2ef39fdc9c
Fb1463 no cluster build (#2100)
* got single node working; refining error messaging and version info to follow

* better implementation that separates the build condition into etcd/enterprise_cluster.go and etcd/plg_cluster.go. go build will default to a clustering version and 'go build -tags plg' will build the non-clustering version

* added Makefile target for 'make plg'

* additional comments, CI/CD update

Co-authored-by: Kasey Rodgers <kaseyrodgers@Kaseys-MBP.attlocal.net>
2022-06-09 12:32:46 -07:00
Seebs
ff7900070c drop the bool from a map that's only using it to check presence
We only actually check presence/absence in this map, we never
set the value stored to false, and we assume in some places that
any value present is equivalent to true, so we might as well
use a map of struct{} and save the several whole bytes of memory.
2022-06-09 10:26:19 -05:00
Samir Patel
42f5d6eea3
[FB-1444] Add sentry.io for error and perf monitoring (#2099)
add sentry for error monitoring and performance tracking. Must call the init function to actually turn on the feature. This is expected to be used in the PLG binary and not the enterprise binary.
2022-06-06 18:29:32 -05:00
reesporte
eab6174388 make pql.Decimal.Value a private big.Int field
This ensures that we can't overflow when adding `pql.Decimal`s together. The
only place we can possibly overflow is when converting pql.Decimal to an Int64,
but that is a risk we have to take. Also, the only place we do this is in our
ToRowser. We could maybe change that to strings, so the presentation of data
doesn't indicate an overflow, but that is a later decision to make. It will
also involve fixing the generate-proto-grpc make command, because that's broken
rn.
2022-06-06 16:44:01 -05:00
reesporte
a0c9eec410 pql.Decimal for DecimalVal in ValCount&GroupCount
This way we can avoid annoying floating point rounding errors.

Check out FB-1359 for an example:
```
--- FAIL: TestExecutor_GroupByStrings (0.55s)
    --- FAIL: TestExecutor_GroupByStrings/3 (0.00s)
        executor_test.go:5433: unexpected result at 0:
             got:{Group:[generals.1.r1] Count:5 Agg:2775
DecimalAgg:27.749999999999996}
            want:{Group:[generals.1.r1] Count:5 Agg:2775 DecimalAgg:27.75}
```
2022-06-06 16:44:01 -05:00
reesporte
50787fd37a Add AddDecimal support to pql
This allows us to add two Decimals together as long
as the result doesn't overflow int64 either in value or in scale.
2022-06-06 16:44:01 -05:00
Samir Patel
3750fea632
add timestamp nils to nullIndices (#2095)
* add timestamp nils to nullIndices

* add test
2022-06-02 15:54:24 -05:00
souhailanoor
64a532b416
FB-1471: featurebase: added relevant details to error for value out of range (#2092)
* added relevant details to error
2022-06-02 14:53:10 -05:00
tgruben
a2f910ce35
[FB-1334] add batch support to clear a mutex on nil (#2091)
* mutex clear on nil support with test

* Update client/batch.go

Co-authored-by: Matthew Jaffee <jaffee@pilosa.com>

Co-authored-by: Matthew Jaffee <jaffee@pilosa.com>
2022-06-01 17:37:03 -05:00
Bruce Baranowski
aa8057e9e4
CICD - Spot instances (#2087)
* spot instance test

* update outputs.tf to provide spot instances

* uptate outputs.tf data_node_ips

* propogate spot instance request tags to the instances
2022-05-31 17:25:09 -04:00
Bruce Baranowski
c0d56e13f2
Remove extra Cloudforlation tags (#2089) 2022-05-31 16:51:22 -04:00
Bruce Baranowski
8490be9fb0
CF tremor delete hotfix (#2088) 2022-05-31 15:35:40 -04:00
Matthew Jaffee
cc2230b4b8 don't encode 'base' in the field options json
it's not something that we can send to the server (it calculates base
off of min and max), and we don't need it in the json string in order
to use it client side when building import requests.
2022-05-29 09:03:27 -05:00
Matthew Jaffee
96f589ce24 add base to FieldOptions.String 2022-05-29 09:03:27 -05:00
Matthew Jaffee
98cb763499 don't use base for timestamp fields 2022-05-29 09:03:27 -05:00
Matthew Jaffee
d4820d872f decode int base from schema in client code
not having this breaks ingest when ingesting int-like fields with
nonzero bases (using the shard transactional endpoint)
2022-05-29 09:03:27 -05:00
Samir Patel
fb81e7a360
[FB-1462 FB-1393] Timestamp fix (#2082)
* serialize base and epoch into req

* fix and validate timestamp import

* refactor overflow check and test
2022-05-27 20:19:06 -05:00
Matthew Jaffee
9fb68b416c add doc comments 2022-05-27 11:25:17 -05:00
Matthew Jaffee
a815bba520 comment cleanup 2022-05-27 11:25:17 -05:00