Commit graph

147 commits

Author SHA1 Message Date
Seebs
ea69b0637d significant refactor of test setup and teardown
We centralize the creation paths for test indexes, fields,
etcetera so they all have a common path, all using standard
test holders. There's still two versions, one for test.* functions
and one for internal. They do share a TestHolderConfig though.

Large hunks of the related APIs are simplified/streamlined.
* Fragments are always created with a Field and don't need
  a workaround in case they don't have it.
* Creation of test fragments, etc., use optional FieldOptions
  but don't specify names because they're all using new holders
  for each thing created anyway. This dramatically reduces
  the complexity of the calls.
* test fragments are created inside test views which are created
  inside test fields, etcetera, so everything is using the same
  logic; test views aren't bypassing the other layers, they're
  creating themselves normally within a field.
* Quite a few things now use the standard runtime/production
  logic instead of being custom workarounds; for instance, instead
  of `mustOpenMutexFragment` creating a fragment and then creating
  a mutex vector for it, we just create a mutex-typed field and
  have the normal runtime code do this.
* Similarly, we now use the same field creation logic that production
  does, instead of having our own test-only thing that validates
  field names directly, so our test that we're validating field names
  is actually testing the runtime code. Yay.
* fragSpec goes away. it was a replacement for fragProxy which existed
  to solve memory allocation problems but replaced them with interface
  overhead problems. Now we just have pointers to things and maintain
  valid data structures.
* Many panics are now Fatal or Fatalf calls.
* Some specific bugs fixed, like a cluster which was requested and
  then had its first node directly overwritten, which isn't valid with
  shared clusters.
* Drop the temp-dir test flag and TempDir variable, we can just use
  $TMPDIR.
* Drop a benchmark of "write file to disk" that was purely a benchmark
  of file write speed, not a benchmark of rendering the data that needs
  to be written.
* Drop the unused "flags" parameter to fragment creation, which was
  only used back when we changed the BSI format.
* Use holder.Txf() rather than index.Txf(). The TxFactory has to be
  holder-level anyway, referring to it via the index is misleading.
* Test holders automatically close themselves and delete themselves,
  we remove various other things that thought they were responsible
  for deleting themselves.
2022-09-30 11:25:27 -07: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
1f32fe05b0 Make not found error more verbose (add name) 2020-08-27 19:45:19 +02:00
sundy-li
768c709937 holder.go: fix some logic errors 2020-04-08 16:35:42 +08:00
Kuba Podgórski
b9fa6da5d2 Simplify Holder's logic 2020-02-03 18:12:15 +01: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
ec09582f44
get read lock only where possible in Holder 2019-07-12 13:36:56 -05:00
Seebs
4b657c1962
use a queue for snapshot operations
As the size of a fragment grows, the cost of snapshots
increases; with a large fragment getting a lot of large writes,
every write will trigger a snapshot, while any other writes have
to wait for that snapshot before they, too, can trigger a snapshot.

To address this, we introduce a background queue of snapshots.
In general, operations which were omitting their ops log writes
and just snapshotting no longer do; they emit an ops log. This does
mean that, in some cases, the ops log is written and then a snapshot
takes place essentially immediately, which costs us some performance.
However, that only actually happens under very light load; under
heavier load, there's generally going to be multiple writes coalesced
into each snapshot, and the ops log writes for them will be much
cheaper than a full snapshot.
2019-07-01 13:16:02 -05:00
Matt Jaffee
3a07abdeae
remove shard validation stuff
it seems to have a bug where there is some race on cluster startup
which can cause it to think that the node doesn't own any shards.
2019-04-22 17:36:40 -05:00
Seebs
c9cebe21bf unbreak holder node ID logic
The attempt to fix up the logic broke returns from loadNodeID()
in some cases, because it was overwriting the node ID generated
in the IsNotExist case.
2019-04-16 12:07:18 -05:00
Seebs
77d49ded64 so much lint
So with the switch to a new linter, we get a lot of new warnings,
and the majority of them are harmless probably, but a few might be
real. Variously just use _ to suppress warnings, or report errors.
There's probably things here that deserve better fixes, but we can
always revisit it.
2019-04-16 12:07:18 -05:00
Todd Gruben
8edd2b3d13
applied travis suggestions 2019-03-20 22:04:20 -05:00
Todd Gruben
27492a11cc
some formating issues 2019-03-20 22:04:19 -05:00
Todd Gruben
38de65eac0
only load shards that are applicable to node 2019-03-20 22:04:19 -05:00
Yuce Tekol
767062ab7c
Adds shardWidth to index info in schema 2019-03-01 14:57:46 +03:00
Matt Jaffee
ef7f04c09d
schema endpoint doesn't return internal fields 2018-12-17 16:01:32 -06:00
Matt Jaffee
45cd48c1b7
change exists field to _exists 2018-12-17 15:44:50 -06:00
Ben Johnson
8e49332b25 Add distributed tracing. 2018-11-21 15:08:33 -06:00
Matt Jaffee
5458eb1656
fix holder.opened race with absurd lockedChan 2018-11-20 14:21:36 -06:00
Matt Jaffee
65f478470f
logging cleanup - start with lowercase unless reporting error or warning 2018-11-20 14:08:06 -06:00
Seebs
a203313143 move Logger and Stats to their own packages
I'd like to add stat tracking to Roaring, which means it
has to be able to import the stats package, which means
stats has to be a package rather than part of the pilosa
package. If stats stops being in pilosa, it still needs
a way to import logger, so logger also has to leave the
pilosa package. Then everything using them needs to import
them and use package selectors on their names.

This doesn't actually add the stats support to roaring,
it just makes it so there's a way to import the stats
code from something in the roaring package.
2018-11-15 15:10:44 -06:00
Todd Gruben
0df193cf98 revert to existing api with panic per jaffee 2018-10-17 10:29:58 -05:00
tgruben
1d102e283d
Merge branch 'master' into fix-logger 2018-10-12 02:11:44 -05:00
Travis Turner
69ef4a3746
allow holder to close/open/close without panic on closing closed channel 2018-10-10 21:29:03 -05:00
Todd Gruben
85ebaf298d removed logging from translate store replaced with error 2018-10-01 11:04:47 -05:00
Travis Turner
9b4c67ee60
rename notnull to exists 2018-09-11 15:15:37 -05:00
Travis Turner
d57dae3749
implement NotNull field with index option trackNotNull 2018-09-11 15:13:55 -05:00
Ben Johnson
f4c9c0fed3
Maintain available shards set.
This commit removes the previous `MaxShard` tracking and replaces
it with an `Available Shards` set tracking. This allows sparse shard
tracking without implicitly tracking all shards in between.
2018-08-22 07:57:58 -06:00
Matt Jaffee
e16c43c3bc
Merge branch 'master' into 1492-ae-and-resize 2018-08-20 09:13:35 -05:00
Travis Turner
f1a460aca7
adds view parameter to sync logic for syncing time fields 2018-08-16 11:27:08 -05:00
Travis Turner
d50a0e853c
change NewTranslateStore() to take an interface for backward compatibility 2018-08-13 12:04:22 -05:00
Travis Turner
b304de6536
Treat coordinator as primary translate store.
Daisy-chain other nodes based on their position in the cluster.
Deprecate the `primary-url` configuration option.
2018-08-13 11:06:16 -05:00
Matt Jaffee
0e467e5492
rename cluster.nodes and fix race in API 2018-08-08 15:11:39 -05:00
Matt Jaffee
16eff6de8c
prevent anti entropy and cluster resize from running simultaneously 2018-08-08 14:41:54 -05:00
Travis Turner
f9a265f94d
fix places where empty IndexOptions were being used 2018-07-23 17:23:54 -05:00
Cody Soyland
29eba09e1e Add IndexOptions to IndexInfo json response 2018-07-19 14:11:14 -05:00
Cody Soyland
4aa8a41fa0 Unexport NewNotFoundError 2018-07-05 23:11:56 -05:00
Cody Soyland
59bbbfc1fb Unexport NewConflictError 2018-07-05 23:11:56 -05:00
Cody Soyland
13a6542a15 Unexport Index.RecalculateCaches 2018-07-05 23:11:56 -05:00
Cody Soyland
0648d0fc75 Unexport Holder.RecalculateCaches 2018-07-05 23:11:56 -05:00
Travis Turner
c10cdc9d22
exclude views from http schema output 2018-07-05 19:15:34 -05:00
Matt Jaffee
0a94d2f10d
Merge branch 'develop' into core-structs 2018-07-05 16:38:14 -05:00
Matt Jaffee
bbb93abd57
remove lots of unused code 2018-07-05 15:35:32 -05:00
Matt Jaffee
2cec75e399
add proto encoding subpackage and use for send and receive message 2018-07-05 12:00:42 -05:00
Travis Turner
44f0b992f6
change all CreateField() methods to take functional options instead of FieldOptions 2018-07-04 21:22:35 -05:00
Matt Jaffee
6417f468bb
wip implement more... still quite broken 2018-07-04 16:50:20 -05:00
Matt Jaffee
f6aef32093
make gossip's interface to Pilosa the API struct rather than effectively being pilosa.Server 2018-07-03 12:58:18 -05:00
Matt Jaffee
06ad83b64b
more unexports - index methods and fields 2018-07-03 08:10:33 -05:00