Commit graph

255 commits

Author SHA1 Message Date
Seebs
e47bdb7889 cleaned up sync from private repo 2022-09-30 11:20:58 -07:00
Seebs
f6d17b1b58 refactor testing to share clusters more often
When doing tests, we create a ton of one-off clusters. This
turns out to be expensive and slow. Fixing it is surprisingly hard.

Fundamentally: If we're sharing clusters, we need to use different
indexes for each test, to avoid clashes. This changes index names.
As a side-effect, this reorders many partition-based things, like
the order keys are returned in. Thus, to fix this, we change a lot
of tests to no longer depend on the *order* in which strings are
returned.

Having done that, we can also discard the ModHasher behavior, since
that only existed to allow us to reliably predict partitioning.

The basic design is as follows: Instead of a cluster being a
[]*Command, a "shareable" cluster is now a []*Command plus some
flags, and a "cluster" is a pointer to a possibly-shared cluster,
plus a link to the specific test using this specific cluster,
and correspondingly, its test name suitably coerced to be a valid
index name prefix.

The "test.Cluster" object now has methods to allow retrieving an
index name, and also implemnts fmt.Formatter to let you use,
e.g., `%i` with it in Sprintf to get "the index name, plus an i".
(This works for everything but %p and %T.)

This allows us to consistently rework all the many things that
use index names in a persistent way.

We also have `MustUnshared` and `MustRunUnsharedCluster` methods
which allow us to specify that a given test needs its own cluster
for some reason. For instance, the tests that want to run backups
need their own isolated cluster, and the tests that want to close
or reopen nodes need their own cluster because a reopened cluster
won't have working GRPC for some reason.

On "closing" a shared cluster (actually the test-specific wrapper
that reflects a given sharing), we delete any indexes starting with
that test's index name prefix. Otherwise, the huge pile of open
indexes prevents `go test -race` from working on MacOS, where we
run out of address space too quickly.

This is fairly enormous but most of the individual changes are
fairly trivial things like replacing the string "i" with "c.Idx()".

We also tweaked a test that failed for me a couple of times to
not depend on sort order.
2022-09-30 11:10:47 -07:00
Seebs
904b19dce1 reduce simultaneous memory usage a bit
Delete indexes after we're done with them from subtests so that
we don't fill up on a huge number of unrelated indexes.
2022-09-30 11:10:47 -07:00
Seebs
964e7d86c8 kill everything that tries to pass nil tx to field/view things
The "field/view will just synthesize a tx" behavior is awful and
also hides a number of fundamental flaws. We distinguish between
"we really do mean to work on a single shard here" and "we intend
to work on the whole field or view", and the latter now take
Qcx instead of Tx.

This eliminates a lot of very weird cases where we checked for
nil Tx and synthesized them, and also gets us away from
field and view taking Tx parameters when no possible Tx
can be constructed which is valid, because Tx are inherently
shard-specific at this time.
2022-09-30 11:10:47 -07:00
CLoZengineer
f9ddb5d5c1
fix: updating code to meet linting requirements (#2171)
* removes unused filesize function

* removes ioutil usage

* updates ioutil.ReadAll to io.ReadAll

* updates ioutil.TempFile to os.CreateTemp

* updates ioutil.TempDir to os.MkdirTemp

* updates ioutil.ReadAll to os.ReadAll

* update ioutil.WriteFile to os.WriteFile

* updates ioutil.Discard to io.Discard

* updates ioutil.ReadDir to os.ReadDir where applicable

* removes unused code in idk

* creates type to use for context value keys

* replaces assert.Nil with assert.NoError for error checks
2022-09-29 12:34:29 -04:00
Fletcher Haynes
da9b57bd45 Updated dependency paths to reflect new repo location 2022-09-06 09:39:22 -07:00
Fletcher Haynes
eb06bb50ae Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
Kuba Podgórski
377d14081a Add extra Clear test (check if existency column bit is set) 2020-02-13 15:20:03 +01:00
Matt Jaffee
2651bfbd88
test and fix authentication of client certs btwn cluster nodes
This change should have been adding the "GetClientCertificate"
function in server/tlsconfig.go. This is in addition to the
GetCertificate func which is only used by servers. It ended up being
much more involved for a few reasons:

1. We had no way of passing a configured HTTP client into the
translate store stuff.

2. Our cluster tests assumed http, not HTTPS, and didn't have any way
to pass the necessary configuration in.

3. I encountered what turned out to be an unrelated bug in
cmd/server_test.go which is why I moved "close(m.Started)" in
server/server.go. Basically, I was running something on port 10111
which caused the test to fail (because it was trying to bind to that),
but the failure was not immediately caught during server startup
because the m.Started channel got closed which allowed the test code
to fall through to where it called m.Close() which then got a nil
pointer exception because m.Handler had never been set up.

4. Our test code was assuming that it could create clients that
ignored the config, which meant they didn't do TLS. I added an
InternalClient() method to pilosa.Server to expose the configured
client.
2019-10-18 15:17:35 -05:00
Ben Johnson
e844e1ad75
Translation store refactor 2019-10-09 08:59:41 -06:00
Ben Johnson
c7c9c1e1d7
v2.0.0
Co-authored-by: Cody Soyland <codysoyland@gmail.com>
2019-10-08 14:56:17 -06:00
Matt Jaffee
5b655418b1
add another single day query test 2019-07-25 08:12:19 -05:00
Matt Jaffee
2c311e685e
add bounds check when getting time rows 2019-07-25 08:12:19 -05:00
Yuce Tekol
8be7bd6956
add tests for MinRow and MaxRow 2019-06-03 13:56:50 +03:00
Ben Johnson
dd4227f5e3
Improve TopN() errors
This commit improves field not found, integer field, and cache errors
for the `TopN()` command.
2019-05-25 15:16:45 -06:00
Ben Johnson
40803372dd
Add min/max constraints; fix tests 2019-05-19 16:05:22 -06:00
Ben Johnson
d4de122549
Add min/max constraints 2019-05-17 15:52:17 -06:00
Ben Johnson
7ed9fba335
Unbounded BSI w/ sign magnitude
This commit implements BSI with variable bit depth using a
sign magnitudeto indicate whether a value is positive or negative.
This also rearranges the existence bit to be the first bit instead
of the last bit.
2019-05-17 15:52:17 -06:00
Matt Jaffee
e185a01e67
add translation for groupby filter arg, improve test 2019-05-10 14:15:06 -05:00
Matt Jaffee
de61d04172
failing test for group by with filter using string keys
also, apparently our API code was assuming that imports with keys
always had timestamps which seemed wrong, so I fixed that.
2019-05-10 13:55:21 -05:00
Matt Jaffee
9e6662fb00
send POSTed schema to all nodes in cluster
also fix a *bunch* of tests that weren't closing the clusters they
created. Cleaned up one test to use t.Run instead of just checking
everything in a loop
2019-04-29 19:31:23 -05:00
Cody Soyland
7ede65bf80
Merge branch 'master' into shardwidth22 2019-04-11 10:10:47 -05:00
Matt Jaffee
55d9d49f2f
add executor test for deprecated range query style 2019-04-05 07:52:25 -05:00
Matt Jaffee
836b467d3d
add support to modify shard width at build time
use "make <x> SHARD_WIDTH=nn"

fix tests to run and pass at different shardwidths

add shardwidth22 test to circle ci
2019-04-04 13:46:26 -05:00
Travis Turner
87b3438cb1
add logic to restrict time range to available views 2019-02-01 15:30:10 -06:00
Travis Turner
a242b8cbaf
add from/to range arguments to Rows() 2019-01-30 16:27:07 -06:00
Travis Turner
30711664e8
ensure ClearRow() arguments get translated 2019-01-29 12:36:54 -06:00
Travis Turner
687b67dc54
prevent omitting zero ids on columnattrs 2019-01-28 13:16:43 -06:00
Travis Turner
8fe966e8a0
Modifying some of the logic around Shift()
add some comments to the shift() logic
improve test coverage
fix full bitmap overflow
add support to specify shift-by amount
2019-01-25 12:54:44 -06:00
Travis Turner
2467d88ddc
Merge branch 'master' into shift-op 2019-01-24 13:56:28 -06:00
Matt Jaffee
b7973b75f1
get rid of init 2019-01-21 16:23:28 -06:00
Matt Jaffee
04c7ab5034
add nolint for init 2019-01-21 16:23:27 -06:00
Matt Jaffee
fe7b926773
make sure more tests and benchmarks can have their temp dir set by flag
This is to allow the directory to be set to where a particular disk is mounted
during benchmarking.
2019-01-21 16:23:27 -06:00
Yuce Tekol
773d661b68
GroupBy legacy Rows 2019-01-21 18:02:51 +03:00
Yuce Tekol
ca7dc073ab
Merge branch 'master' into 1805-rows-call-format 2019-01-18 17:48:58 +03:00
Yuce Tekol
c30f9bc192
Rows accepts a fields param for backward compat. 2019-01-18 17:41:54 +03:00
Matthew Jaffee
6f21eb32de
Apply suggestions from code review
Co-Authored-By: travisturner <travis@pilosa.com>
2019-01-17 14:47:35 -06:00
Yuce Tekol
dc735c17b8
Fixes #1805. Fixes Store call error messages 2019-01-16 20:52:33 +03:00
tgruben
e5df52836e
Merge branch 'master' into shift-op 2019-01-15 08:57:28 -06:00
Travis Turner
44f53a5f1d
raise an error on Rows() query against a time field with noStandardView:true 2019-01-14 16:14:45 -06:00
Yuce Tekol
76de81dacf
updated row range test 2019-01-14 23:46:34 +03:00
Yuce Tekol
d75e9eb772
updated row range test 2019-01-14 23:45:58 +03:00
Yuce Tekol
600b39e4e5
updates row range test with a timestamp > the default end timestamp 2019-01-14 23:40:31 +03:00
Yuce Tekol
9f6d489be8
fixes #1823. Updates tests and docs for row range 2019-01-14 14:39:08 +03:00
Travis Turner
f7e3296f62
fixes a bug on upper end of bsi range queries 2019-01-11 17:05:29 -06:00
Ben Johnson
9d1e5ca8ce
Merge Range() into Row() call.
This commit refactors the `Range()` call and merges its functionality
into the `Row()` call.
2019-01-09 15:10:49 -07:00
Yuce Tekol
65c30283d7
adds tests for GroupBy with keys; removes unused Bit message from proto 2019-01-03 15:20:02 +03:00
Matt Jaffee
ed637e6921
add test for group by with invalid filter 2018-12-21 17:24:44 -06:00
Matt Jaffee
81d08be044
fix PQL, Rows and Group By problems
make sure that args which are Uints are positive and return an error if not.

improve group by error messages if field for Rows query is invalid
2018-12-21 14:16:55 -06:00
Matt Jaffee
97eb94397f
fix Rows bug where Pilosa would crash without 'field' argument. 2018-12-21 11:55:25 -06:00