Commit graph

228 commits

Author SHA1 Message Date
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
zhanglistar
93b6adbf65 1. modify unprotectedGenerateResizeJob to return early iif resizing job
not null
2020-04-11 22:48:28 +08: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
c0d067b7ee
move context timeout inside loop, so context gets a fresh deadline 2019-06-21 12:15:58 -05:00
Matt Jaffee
481c85acae
more info if nodeleave confirmation queries fail 2019-06-20 17:32:57 -05:00
Todd Gruben
b9ab21dfd2 Decreased the number of retries for dead node confirmation 2019-06-05 15:13:53 -05:00
Todd Gruben
e4dbafd03e Duplicate log entry 2019-06-05 14:58:35 -05:00
Todd Gruben
5ddbe0b51a Merge branch 'confirm-fail' of github.com:tgruben/pilosa into confirm-fail 2019-06-05 14:54:08 -05:00
Todd Gruben
c99071d5bf timeout handleded incorrectly;added tests 2019-06-05 14:53:35 -05:00
tgruben
2376a2bcec
Merge branch 'master' into confirm-fail 2019-06-05 11:42:10 -05:00
Todd Gruben
085e29543e False Positive nodeLeave events put cluster in an unusable state 2019-06-05 11:28:41 -05:00
Travis Turner
b46ff7b990
fix some lint warnings raised in VS-Code 2019-04-17 18:10:05 -05:00
Seebs
f15347064f fix race in cluster state transition
The anonymous goroutine, if it gets an error, can race with other
changes. Make the values we intend to call it on parameters so it will
work with those even if other things are happening.
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
Matt Jaffee
7b436a4e30
remove now-unused cluster.status method 2019-04-06 09:46:39 -05:00
Matt Jaffee
79968e5d2f
fix unlocked access to cluster.nodes 2019-04-05 15:40:25 -05:00
Matt Jaffee
d5cfe880f7
address race condition by getting cluster nodes with lock
needed an unlocked version of sendsync for use within the cluster, so also
implemented that. Added a number of tests trying to reproduce the issue, but was
not able to. Not sure it's worth keeping the new tests.
2019-04-05 15:40:24 -05:00
Matt Jaffee
33b54c68d5
add lock on cluster.OwnsShard 2019-03-20 22:04:20 -05:00
Matt Jaffee
e33ca2d0ae
use UnionInPlace in import-roaring
get the count of the existing fragment and compare it to the incoming bits to
decide which should be unioned into the other. This should generally result in
far fewer allocations, though there is much work that needs to be done within
UnionInPlace to further improve things.

unrelatedly, I added a TODO to change the long-query-time option to move it out
of cluster. It should probably be happening at the API level so that different
handlers can reuse it, but if we're going to do that we'll want to make sure
that any potentially time intensive operations are pulled into api from
handler (e.g. protobuf decoding)
2019-03-11 17:43:55 -05:00
Matt Jaffee
daa87d8e12
fix staticcheck warnings 2019-01-21 14:24:11 -06:00
Travis Turner
fc1de2dba9
cluster.Nodes() just needs a read lock 2019-01-18 14:49:58 -06:00
Travis Turner
ca2241731d
fix tracing message. prevent reallocation of availableShards 2018-12-18 08:34:48 -06:00
Travis Turner
d28170ddc6
Syncs AvailableShards when handling a ResizeInstruction.
There was a situation where availableShards on a new
node were not in sync with the cluster, so queries
following a resize were incorrect.
- Start a one-node cluster.
- Write data to shards 0 and 1
- Start a second node.
In the case where the hash algo was moving shard 0 to
node1, then node1 only knew about shard 0, so queries
to node1 would be incomplete.

This PR modifies the ResizeInstruction message to replace
`Schema` with `NodeStatus` (which contains both `Schema` and
`AvailableShards`). So now when a resize instruction is received,
the receiving node is able to sync its schema and availableShards.
2018-12-18 08:34:48 -06:00
Travis Turner
84fddbc67f
Replace the /fragment/data endpoint to support cluster resizing 2018-12-18 08:34:47 -06:00
Matt Jaffee
8b3e5b998a
fix data race which appears to be unrelated to previous changes 2018-12-11 15:45:44 -06:00
Matt Jaffee
7e6c406212
fix bug where cluster goes into RESIZING instead of NORMAL
running
"make clustertests
DOCKER_COMPOSE=internal/clustertests/docker-compose-replication2.yml"

shows this issue (just remove the change in cluster.go).

Also removed two unrelated lines of code that appear to be doing absolutely nothing.
2018-12-11 09:22:03 -06:00
Matt Jaffee
ef6db5cc1a
propogate updates to node details (not just additions and deletions)
to all nodes in cluster, not just coordinator
2018-12-04 14:03:14 -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
Matt Jaffee
deae8ce7c0
improvements to clustertests and fix cluster pause bug by state sharing 2018-11-09 11:28:19 -06:00
Ben Johnson
f8608227d1
Add DeleteAvailableShard()
This commit adds the ability to remove an 'available shard'
from the shard cache. This does not affect shards known to be
available because of local data.
2018-10-17 08:50:06 -06: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
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
1901ffada6
make sure cluster gets into DEGRADED state when adding nodes
previously, losing a node could cause the cluster to go from NORMAL->DEGRADED,
but adding a node would not cause it to go from STARTING->DEGRADED. Cody brought
this up in code review.
2018-08-08 19:42:30 -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
Matt Jaffee
bb32706cb6
support DEGRADED in removeNode
now, nodes which have failed and been removed from the running cluster state can
still be manually removed to trigger a cluster resize event. This is important
because otherwise there is no way to cause the cluster to resize itself if a
node fails and you don't want to add a node to replace it.
2018-08-06 16:55:23 -05:00
Matt Jaffee
ba5b46898f
fix determineClusterState bug and add more test cases 2018-08-06 14:55:38 -05:00
Matt Jaffee
48af3adc21
add degraded cluster state and handle node failure
cluster is in degraded state when some number of nodes greater than 0 but less
than replicaN have failed. This is sort of a hybrid of "STARTING" and "NORMAL"
states because we can still respond to queries as in the NORMAL state, but we
need to be alert to re-add nodes to the cluster if they come back online which
required some changes to the cluster logic.

In order to make debugging easier, the test.MustRunCluster functionality now
names the nodes in the cluster explicitly as "node0", "node1", etc. "node0" is
the coordinator.

A number of TODOs are left in the test for scenarios that need to be checked.
2018-08-06 11:57:24 -05:00
Cody Soyland
e9523063b5 Fix linter issues: unused 2018-07-20 10:33:29 -05:00
Cody Soyland
187ded0a52 Fix linter issues: maligned 2018-07-19 11:07:59 -05:00
Matt Jaffee
30e0d42c3d
remove incorrect nodeJoin comment 2018-07-19 09:43:48 -05:00
Matt Jaffee
774e91ad30
finish commenting methods as unprotected. 2018-07-19 09:40:23 -05:00
Matt Jaffee
3b8b190849
add nolint unparam for setStateAndBroadcast 2018-07-19 09:17:36 -05:00