Commit graph

8696 commits

Author SHA1 Message Date
Matthew Jaffee
22a60a19f8
Merge pull request #1869 from molecula/qol-tweak
clean up files generated by tests
2022-01-17 16:35:24 -06:00
Matthew Jaffee
e297a6775d have simulacradata tests clean up generated files 2022-01-17 09:39:28 -06:00
reese
80f9ddaa02
Merge pull request #1868 from molecula/security-logging
FB1109: authn/z audit logging
2022-01-15 12:43:32 -06:00
reesporte
04a51a7819 remove shadowed ok
thanks golangci-lint
2022-01-15 12:25:09 -06:00
reesporte
50f9b0d1b6 Merge branch 'master' into security-logging 2022-01-15 12:21:38 -06:00
reesporte
7644922406 adds logging to all network requests
addresses ticket FB-1109:
when auth is turned on, we log:
- source ip (if available)
- user-agent
- user id
- user name
- query string
- request endpoint

also adds some minor tweaks and comments  to chkAuthZ flow
2022-01-15 12:21:27 -06:00
Matthew Jaffee
231a395138
Merge pull request #1867 from molecula/external-lookup-gitlab
get external-lookup tests running in Gitlab CI
2022-01-15 08:13:10 -06:00
Matthew Jaffee
d5bd031451 better error reporting if delete fails 2022-01-14 21:09:16 -06:00
Matthew Jaffee
a08560d01e get external-lookup tests running in Gitlab CI
I was going to write a docker-compose thing for this to run postgres
alongside the Go tests, but then saw that Gilab has this handy-dandy
notion of a service, so used that.
2022-01-14 21:09:16 -06:00
reese
f9c7ff3629
Merge pull request #1866 from molecula/fb1130
[fb-1130]: filter http response and lockdown endpoints
2022-01-14 17:45:51 -06:00
reesporte
3fdf4e2d8b Merge branch 'master' into fb1130 2022-01-14 16:06:45 -06:00
reesporte
baf02748be filter http response and lockdown endpoints
- fixes required permissions on some http endpoints
- filters http endpoints:
    - /ui/usage
    - /schema
    - /schema/details
- filter GRPC show tables, fields
- allow admins to do anything
2022-01-14 16:05:54 -06:00
Matthew Jaffee
34c64fbaba
Merge pull request #1865 from molecula/wrapping-etcd-retry
add wrapping to differentiate etcd errors
2022-01-14 15:58:56 -06:00
Matthew Jaffee
555d185929 add wrapping to differentiate etcd errors
we had a CI job fail in an interesting way, but can't tell if the
etcd retrying stuff is working, so adding in this wrapping so we can
better differentiate the errors if we see it again.

Job is here: https://gitlab.com/molecula/featurebase/-/jobs/1977060827

Failure is:

```
=== RUN   TestClusterStuff
    cluster_test.go:36: creating index: against http://pilosa2:10101/index/testidx 404 Not Found: 'creating index: sending CreateIndex message: executing request: against http://pilosa3:10101/internal/cluster/message 500 Internal Server Error: 'processing message: getting index: testidx: etcdserver: request timed out
        ''
--- FAIL: TestClusterStuff (8.85s)
```
2022-01-14 14:01:37 -06:00
reese
605da1e074
Merge pull request #1861 from molecula/bearer-conversion-squashed
[fb-998] [fb-1131] [fb-1129] addresses multiple authn/z tickets
2022-01-14 13:52:24 -06:00
reesporte
89567b791b Merge branch 'master' into bearer-conversion-squashed 2022-01-14 12:34:22 -06:00
Matthew Jaffee
b2afe7ad3b
Merge pull request #1863 from molecula/moar-cicd-clustertests
add clustertests to gitlab CI
2022-01-14 12:32:40 -06:00
reesporte
9f37cf7b48 Merge branch 'master' into bearer-conversion-squashed 2022-01-14 12:32:06 -06:00
reesporte
cf2410fea6 addresses multiple authn/z tickets
* fb-998 - authn/z enabled in handlers (kitchen-sink ticket)
    - authorization is enabled through the use of a bearer token (using header "Authorization")
    - authorization may occur through the use of an "Authorization" header or "molecula-chip" cookie
    - ui is updated for changes to handler
* fb-1131 - protect grpc endpoints
    - GRPC endpoints now check authorization if auth is enabled
* fb-1129 - inter-node communication
    - the following endpoints use the secretKey for authentication:
        - /internal/cluster/message: POST
        - /internal/translate/data: GET, POST

* added test to api_test.go (TestAuth_MultiNode) testing various auth/permissions stuff on a multi-node cluster

not included:
    - fb-1130 - filter response of endpoints
    - fb-1109 - improved audit logging

@jaffee [are you not entertained](https://www.youtube.com/watch?v=mutgotxrcqg)

Co-authored-by: souhailanoor <90720110+souhailanoor@users.noreply.github.com>
Co-authored-by: tgruben <tgruben@gmail.com>
Co-authored-by: 54mir <48686912+54mir@users.noreply.github.com>
Co-authored-by: kcrodgers24 <49999391+kcrodgers24@users.noreply.github.com>
2022-01-14 12:31:32 -06:00
Matthew Jaffee
2f30bcda45 add clustertests to gitlab CI
had to install some dependencies and things on the runner which are
detailed in a comment.
2022-01-14 11:05:41 -06:00
pokeeffe-molecula
f6c458b093
Merge pull request #1862 from molecula/cicd-smoketest
Now with working integration testting
2022-01-13 15:27:17 -06:00
pokeeffe-molecula
0b9d108626
Merge branch 'master' into cicd-smoketest 2022-01-13 14:52:24 -06:00
pokeeffe-molecula
dcc295b25d fixed broken shell script 2022-01-13 14:24:44 -06:00
Matthew Jaffee
5048c8712f
Merge pull request #1859 from molecula/fieldView
[SUP-132] track field directly in view to prevent deadlocks
2022-01-13 13:50:33 -06:00
pokeeffe-molecula
ff16924a0a fixed path typo 2022-01-13 13:31:41 -06:00
Matthew Jaffee
dad244e0d3 skip sometimes-failing test of experimental code
this is killing us in CI for no good reason
2022-01-13 13:16:57 -06:00
Seebs
6fba8aba8b track field directly in view to prevent deadlocks
The central reason this exists:

**sync.RWMutex can block read locks even when no write lock is yet held.**

If a write lock is *requested*, this can block future read locks. In
particular, this means that recursive read locks are unsafe. But there's
additional problems.

The specific case that bit us involves not two, but *three* things
running at once.

Thing #1: executor doing AvailableShards. This RLocks the index, and
then each field, and then each view. To complete, it must be able to
obtain a read lock on each view in turn.

Thing #2: DeleteField. This Locks the index. Even if it is stuck
waiting for the lock (which it will be until AvailableShards completes),
it can prevent *additional* RLocks of the index.

Thing #3: CreateFragment. This Locks a view, then RLocks the index in
order to look up a field.

CreateFragment can't proceed until DeleteField completes. DeleteField
can't proceed until AvailableShards completes. And AvailableShards
can't proceed until CreateFragment completes.

Solution: Cache the *Field in the view, so we don't need a read lock
on the field or index to complete a CreateFragment.
2022-01-13 13:16:57 -06:00
pokeeffe-molecula
f4d28b840a stop gauntlet from running every build 2022-01-13 13:00:02 -06:00
pokeeffe-molecula
da3cabe642 Merge branch 'master' into cicd-smoketest 2022-01-13 12:57:42 -06:00
pokeeffe-molecula
04a2df3036 added basic integration tests 2022-01-13 12:57:26 -06:00
Matthew Jaffee
4a1e53421e
Merge pull request #1858 from molecula/retryEtcd
[SUP-130] handle ErrTimeout in etcd embed "retryClient"
2022-01-13 12:54:10 -06:00
Seebs
84adefe6a5 handle ErrTimeout in etcd embed "retryClient"
This tries to be more correct/careful about retries (checking against
the actual exported errors from etcdserver, not just the string
representations), and also supports retrying on timeouts, not just
on client changes. It can also retry more than once, mostly in case
we hit one of each of those.

For timeout errors, we mostly use the fact that it's a timeout to
give us a reasonable backoff, but then delay a fraction of a second
longer just to give it a moment to recover if the ErrTimeout is
masking something else that took longer.
2022-01-13 11:47:57 -06:00
Bruce Baranowski
c60bed21c3
Merge pull request #1840 from molecula/IO-47
added tags to sg terraform
2022-01-12 19:18:04 -05:00
bruce-b-molecula
ef5736c73e added tags to sg terraform 2022-01-12 18:59:28 -05:00
Ben Johnson
24c38cd6b9
Merge pull request #1848 from molecula/fb-828
[FB-828] Fix RBF WAL size check
2022-01-12 09:59:01 -07:00
Ben Johnson
a49a14652f Fix RBF WAL size check
This commit changes the max WAL size calculation to double the
number of bitmap pages in the WAL as they require an extra header
page. Previously, this was causing the WAL to be overrun and
references to those pages were outside the mmap range and caused a
panic.
2022-01-12 08:26:14 -07:00
pokeeffe-molecula
5f5caff30d
Merge pull request #1855 from molecula/cicd-smoketest
Really get gauntlet to run in master
2022-01-11 18:42:02 -06:00
pokeeffe-molecula
24a963ef52
Merge branch 'master' into cicd-smoketest 2022-01-11 18:27:22 -06:00
pokeeffe-molecula
d896953af4 stop gauntlet from running on push 2022-01-11 18:08:14 -06:00
pokeeffe-molecula
8919d9d5d3 change the way we call ssh 2022-01-11 15:51:18 -06:00
Matthew Jaffee
afc1cd62b7
Merge pull request #1853 from molecula/fb-1115-rip-rowcache
FB-1115 rip out rowcache
2022-01-11 14:10:05 -06:00
Matthew Jaffee
34393dee09 rip out rowcache
not strictly backward compatible... hopefully no one is actually using
the rowcache config option
2022-01-11 13:49:09 -06:00
pokeeffe-molecula
c647c0c079
Merge pull request #1851 from molecula/cicd-smoketest
Cicd smoketest
2022-01-11 12:56:07 -06:00
pokeeffe-molecula
7e8d217208 so much fail... 2022-01-11 12:21:38 -06:00
pokeeffe-molecula
5056a8ea4d Update .gitlab-ci.yml 2022-01-11 11:39:45 -06:00
pokeeffe-molecula
562d665014
Merge branch 'master' into cicd-smoketest 2022-01-11 11:37:23 -06:00
Matthew Jaffee
951368acea
Merge pull request #1852 from molecula/fb-1118-commented-prints
remove a bunch of commented print statements and unecessary prints
2022-01-11 11:08:48 -06:00
pokeeffe-molecula
130c2265ca
Merge branch 'master' into cicd-smoketest 2022-01-11 11:00:58 -06:00
Matthew Jaffee
df88b5a78c remove a bunch of commented print statements and unecessary prints 2022-01-11 10:42:44 -06:00
Matthew Jaffee
888e68f884
Merge pull request #1847 from molecula/1147-slow-int-import
FB-1147 FB-1149 add sorting for ints/mutex in batch importer
2022-01-11 10:41:45 -06:00