Commit graph

7861 commits

Author SHA1 Message Date
Samir Patel
d828d73eae Add APISetOptions test for coverage 2021-10-29 19:04:21 -05:00
Samir Patel
21969b1637 Add unit test 2021-10-29 16:52:09 -05:00
Samir Patel
b787fccf3a Add cmd option to disable cardinality calc 2021-10-28 10:25:26 -05:00
seebs
6cb9ce0315
Merge pull request #1731 from molecula/core930
[FB-930] remove bolt backend, bluegreentx, and a ton of unused API surface
2021-10-26 13:37:16 -05:00
Seebs
ad30a926f4 Giant Commit: drop a bunch of stuff we don't use.
These commits are hard to disentagle, and doing them separately means
re-modifying the same chunks of code several times before removing it,
and similar things.

Basically:
(1) Drop the bolt backend storage.
(2) Drop the blue-green wrapper that compares two backends.
(3) Drop unused or barely-used Tx API components from all the
remaining backends.
(4) Minor related cleanup to simplify things related to these.

The boltdb backend existed only to verify RBF. The blue-green wrapper
was mostly used to verify RBF, but in practice we had to do a lot
of working around that, and it introduced a lot of special cases.

Types removed:

IteratorFinder: Used only to implement the roaring iterator
on top of boltdb, and to complicate the way it worked in roaring.
Reverted the complications. Also unexport NewSliceContainers
which is used only for that outside of roaring's internals.

PortMapper from cluster_internal_test.go: Used only for a test
we removed early this year. Never used for anything else.

RawRoaringData: Totally unused.

TxStore: Totally unused.

Functions removed from Tx API, and sometimes corresponding
members were removed from structs:

* Dump: debugging code, I don't think I found any actually reachable
  paths to it.
* Group: only used for debugging TxGroup stuff
* IncrementOpN: only used by fragment, fragment can increment its
  own opN.
* Options: unused?
* Pointer: debugging only
* Readonly: used only to decide how to handle Tx in a TxGrp,
  but we never add a non-readonly Tx to a TxGrp. Removed also all
  the corresponding write-aware stuff.
* RoaringBitmapReader: Used exactly once, can just be a bm.WriteTo.
* Sn (and OpenSnList): Unused
* UnionInPlace: unused and conceptually-invalid; it didn't write
  to storage and shouldn't have, and was just "create a bitmap
  then call union-in-place", which we can do directly.
* UseRowCache: just checked storage.UseRowCache.

Other things removed:

The SetRequiredForAtomicWriteTx and ClearRequiredForAtomicWriteTx
functions go away, since nothing now seems to be using them? Same
for holder_internal_test's `testHasBit` and `testMustNotHaveBit`,
which were unused.

The DBPerShard "DeleteDBPath" and "HasData" functions and related
parts were mostly unused; took out the parts that were never
actually being reached.

Changed the API of one function to simplify special cases and
remove things:
* ImportRoaringBits had a special "data" argument which gave it
  subtly different semantics for RBF and roaring (for roaring, it
  could produce a roaring bitmap *with ops log*), didn't seem to
  be adding much. Removed corresponding "readStorageFromArchive"
  which is not otherwise used.

Also took out various debugging/dumping functions that were unused
and may have bitrotted.

Dropped a test from txfactory_internal_test, and the "pjobs"
code, because those two were the only things that needed Barrier
and thus idem, which lets us drop two more dependencies. We already
have errgroup for grouping things which want to terminate as
soon as one of them errors, approximately. To do better we'd have
to have context-threading, really.

Unbroke the WriteFragment test for non-roaring tests and made it
not roaring-only.
2021-10-26 12:30:25 -05:00
Seebs
ecd0ecc6d1 add featurebase to .gitignore
we ignored pilosa binaries but we've renamed so now the binary is named
featurebase.
2021-10-26 09:15:44 -05:00
Seebs
dc8702ea3e use testhook auditor to track Qcx open/close
This also requires doing something to keep the TxGroup in each Qcx
from holding its Tx references after the Qcx closes, because otherwise
the list of Qcxs that we keep to verify that they all got closed ends
up keeping every shared/read-only Tx open forever, resulting in many
gigabytes of memory usage when running with the race detector.  To
avoid having to reason about whether anything would ever access a nil
TxGroup, or run through iteratively zeroing maps, we just make a new
empty group at that point.
2021-10-26 09:13:53 -05:00
reese
53b7d9e210
Merge pull request #1736 from molecula/time-estimate-rules
SUP-75: Change time estimation to use avg time per message
2021-10-25 15:42:09 -05:00
reesporte
d51c6b950f meaningless commit to kick off sonarcloud with new rules 2021-10-25 15:24:55 -05:00
reesporte
d934d117da add test case names 2021-10-22 14:52:57 -05:00
reesporte
5dd4b0e048 rename vars to more sensible names 2021-10-22 14:49:05 -05:00
reesporte
bd0d68b2fd rename function, return pctDone 2021-10-22 12:54:46 -05:00
reesporte
681ed9923d add license header 2021-10-22 11:29:09 -05:00
reesporte
0f108a612d refactor and add unit tests 2021-10-22 11:25:03 -05:00
reesporte
45e36600f3 don't include .*.swp 2021-10-22 10:49:07 -05:00
reesporte
7102de9f60 off by one error fixed 2021-10-21 16:19:57 -05:00
reesporte
27515a3f98 number of sent messages is just i silly 2021-10-21 14:24:27 -05:00
reesporte
adf3e528f5 Change time estimation to use avg time per message
In [SUP-75](https://molecula.atlassian.net/browse/SUP-75?atlOrigin=eyJpIjoiYmU5MzdkMmUyZTAyNGQ2Y2IzMDMzYTgzMDU2Y2ZhNmMiLCJwIjoiaiJ9) Allen
pointed out that the time estimation is really good for the first couple lines of output, but gets exponentially worse as execution continues.

After looking into it, it looks like we’re currently using a heuristic based on the amount of messages processed in the previous
second(ish) which is what results in that sort of exponential drop off.

To remedy this, I adjusted the time estimation calculation to use the average time per message up to the point of calculating the new
estimate to ideally improve estimates over time, with the trade-off of a potentially less accurate estimate to begin with.
2021-10-21 13:09:24 -05:00
Fletcher Haynes
3605449b53
Merge pull request #1734 from molecula/gitlab
Migrated Cloud Build to GitLab
2021-10-15 10:07:31 -07:00
Fletcher Haynes
72a2689e4c Migrated Cloud Build to GitLab
This adds in a config YAML file for gitlab
2021-10-14 18:37:06 -07:00
nagamocha3000
263a5b86c9
Merge pull request #1733 from nagamocha3000/core-919-field-deadlock
CORE-919 Fix deadlock on field recreation after node restart
2021-10-14 18:20:25 +03:00
nagamocha3000
c6b7089332 Add comment as to why we are using os.Exit instead of panic 2021-10-14 18:07:02 +03:00
nagamocha3000
bce008df26 Fix deadlock on delete then recreate field after node restart 2021-10-14 17:04:09 +03:00
nagamocha3000
07a340ba9d Add test for deadlock on field recreation 2021-10-13 23:11:56 +03:00
tgruben
9d2d30feb7
Merge pull request #1718 from tgruben/sql2-type
Better type support in result set for looker (postgres) sql2 interface
2021-10-12 12:36:15 -05:00
Todd Gruben
4d4f64a339 address ben's comments 2021-10-12 11:21:14 -05:00
Todd Gruben
5d57d361f4 quite down 2021-10-12 10:50:03 -05:00
Todd Gruben
e4e0d13837 go mod tidy correction? 2021-10-12 10:40:32 -05:00
Todd Gruben
c4c7d91bf0 make linker happy 2021-10-12 10:24:19 -05:00
Todd Gruben
34dad863e2 wip 2021-10-12 10:20:24 -05:00
Todd Gruben
caee5680c3 wip 2021-10-12 10:20:24 -05:00
Todd Gruben
1a068cf0e2 added type support for looker; added intercept for yellowfin typelen query 2021-10-12 10:20:24 -05:00
Kasey C. Rodgers
c4a348724e
Merge pull request #1726 from molecula/csv-error-17
adds more detail to CSV ingest error message
2021-10-12 07:04:22 -07:00
Kasey C. Rodgers
25230693c5
Merge branch 'master' into csv-error-17 2021-10-08 13:55:58 -07:00
Kasey C. Rodgers
ded60af8c3
Update pilosa.go
Co-authored-by: Matthew Jaffee <jaffee@pilosa.com>
2021-10-08 13:46:17 -07:00
Fletcher Haynes
276dab6d12
Merge pull request #1728 from molecula/cicd
Added in various CI files
2021-10-08 12:39:08 -07:00
Fletcher Haynes
6eefd2d1f0
Merge branch 'master' into cicd 2021-10-08 12:18:26 -07:00
Fletcher Haynes
155855d97f Added in various CI files
This adds in configs for Cloud Build, Artifactory, and GitLab CI/CD.
2021-10-08 12:16:03 -07:00
tgruben
746212f63f
Merge pull request #1727 from tgruben/wip-partial-restore
partial backup/restore
2021-10-08 12:58:33 -05:00
Todd Gruben
71f1e6f1dd linter 2021-10-08 12:20:53 -05:00
kcrodgers24
b2c73b6a41 changes error message text for additional clarity 2021-10-08 09:47:16 -07:00
Todd Gruben
786bebe58b partial backup/restore 2021-10-08 10:50:52 -05:00
kcrodgers24
1f257aab9c adds more detail to CSV ingest error message 2021-10-08 08:27:49 -07:00
Ben Johnson
0d548094eb
Merge pull request #1724 from molecula/sql-inner-join
CORE-809: Aggregate COUNT() with INNER JOIN
2021-10-07 14:56:28 -06:00
Ben Johnson
98e7ade591 CORE-809: Aggregate COUNT() with INNER JOIN 2021-10-07 14:20:07 -06:00
seebs
39aa12b12a
Merge pull request #1723 from molecula/seebs/genfix
don't close storage after failing to open cache
2021-10-01 15:52:42 -05:00
Seebs
8433f81b68 don't close storage after failing to open cache
If the inner function that handles the open of storage and cache
fails, we close the fragment. If we closeStorage() before that,
then we can try to close the storage again, which causes a panic
when we try to mark the generation as Done again.

I was going to set f.gen = nil after marking it done, but I'm
not feeling safe about that -- there's too many places where
we check things about f.gen, and it seems unsafe. The generation
code should be removed at some point, because it all exists
as a workaround for not having any way to detect when reads are
"done", because we didn't want to do something huge and intrusive,
like adding the Tx system and requiring transactions to get
closed.
2021-10-01 11:02:45 -05:00
seebs
8ed922d30e
Merge pull request #1720 from molecula/fsync
Fsync
2021-10-01 10:58:13 -05:00
Seebs
9db87f78d0 fix go.mod/go.sum 2021-10-01 10:45:08 -05:00
Seebs
214a1492a8 kill off a ton more fsyncs
Performance of tests on MacOS has been atrocious for a while, and
a lot of that is fsync, so we're trying to make that optional.

To test all of this, I modified RBF to panic if anything tried to
open an RBF database without disabling fsync, and ran the tests that
way, and tracked down the various places this could still happen.

There's a lot of places in our tree where we were creating
test holders which were not getting created with fsync disabled, which
results in a surprisingly large number of points at which we end
up calling fsync in tests, which makes tests much slower than they
need to be. There's also a bunch of places where the flags don't get
propagated correctly; for instance, storage.fsync didn't propagate
to the RBFConfig.

We add an "fsync enabled" flag to OpenTranslateStoreFunc, so we can
tell translation stores that we don't need syncing, so the server's
config can be passed on appropriately.

More of the test code that sets things up is correctly configuring
that flag by default.

We also change the barely-used bolt storage backend to support this as
well.

With this done, the only calls to fsync left in a run of `go test -short`
in the top-level directory are from the zap logger in etcd, and consumed
around 0.03 seconds. The overall impact is that `go test -short`
went from "takes enough more than 10 minutes that i don't know how long
it takes" to about 2.5 minutes.
2021-10-01 10:45:08 -05:00