Commit graph

314 commits

Author SHA1 Message Date
Travis
7c2f6a9bae adds a basic gossip implementation using hashicorp/memberlist
Changes Gossiper to NodeSet.
Adds StaticNodeSet (for testing) and GossipNodeSet (for memberlist) implementations.
Changes NodeSet interface to return a pilosa-specific generic instead of `NodeSet interface`.
Removes NumMembers from interface (which is specific to memberlist).

Implements a Messenger interface with which to send inter-node messages via NodeSet.
The Pilosa implementation occurs in the GossipNodeSet.

Implements the Messenger as an object on Server, Handler, and Index.

Uses HealthStatus constants.
Removes commented-out code.

for gossip, make sure to bind to both host and port, and advertise those as well

adjust messenger to work with the db schema logic

add dependencies: hashicorp/memberlist, golang.org/x/sync
add dependency: golang.org/x/net

Uses `errgroup` to handle errors from broadcast messages.
Marshals message one time instead of once for every node.
Adds error handling for some errors that were being swallowed.
2017-04-19 10:13:38 -05:00
Travis
95a546e138 adjust tests and client to comply with the new HTTP endpoints 2017-04-18 14:19:36 -05:00
Travis
63df926968 put the handler router endpoints in alphabetical order 2017-04-18 14:12:59 -05:00
Cody Soyland
a6c7a0f894 WIP handler changes 2017-04-18 14:12:59 -05:00
Cody Soyland
4397e13a82 Use gorilla mux instead of big switch statement 2017-04-18 14:12:59 -05:00
Ben Johnson
d32edb5329 Add cacheType to frame options.
Previously the cache type (`lru` or `ranked`) was determined by
checking the ending suffix of the frame. If it ended with a `.n`
then it was ranked. Otherwise it was an LRU.

This commit changes frames so that a `cacheType` option can be
passed in during creation to set either `lru` or `ranked`.
2017-04-18 08:24:58 -06:00
Linh Vo
9abdb29269 remove duplicate code, move ValidateName out of validateOptions 2017-04-06 23:28:16 -05:00
Linh Vo
b2db339741 remove comment code 2017-04-06 16:20:08 -05:00
Linh Vo
37ffcd4ed9 refactor validateOptions 2017-04-06 16:03:35 -05:00
Linh Vo
07e689ed58 custom UnmarshalJSON unit test 2017-04-05 15:40:02 -05:00
Linh Vo
22475df035 revise unmarshalJSON 2017-04-05 10:50:56 -05:00
Linh Vo
1be7a42d14 custom Unmarshal JSON 2017-04-04 14:50:43 -05:00
Linh Vo
abd696ca56 rm govalidation phase 2017-04-03 10:50:19 -05:00
Linh Vo
c034293967 validate db and frame 2017-04-02 22:26:36 -05:00
Ben Johnson
912fcb3464 Separate max slices for standard and inverse views.
Previously only the standard max slice was available. This commit
changes it so that the inverse max can be retrieved separately
through the `DB` and `Frame` types as well as through the
`HTTP` API and `Client`.
2017-03-28 13:01:04 -06:00
Ben Johnson
eff08af112 Separate physical data layout with views.
Previously, multiple frames with different prefixes were used to separate
different data layouts. This included separating standard row/column
layouts from inverted column/row layouts as well as storing aggregate
information for timestamp data.

Unfortunately, this caused frame meta data to be copied between multiple
frames and it made it difficult to keep these frames in sync.

This commit separates these different physical layouts into `Views`.
A `Frame` now has one or more views which represent each layout.
Fragments have been moved from under the `Frame` to be contained
within the `View`.

There are two primary views:

- `standard`
- `inverse`

If a frame has a time quantum, then views are generated for these
each of the standard/inverse views. For example a time quantum
of `YMDH` for the date `2000-01-02T00:00:00Z` would create the
following views:

- `standard_2000`
- `inverse_2000`
- `standard_200001`
- `inverse_200001`
- `standard_20000102`
- `inverse_20000102`

From the user's perspective, nothing should change in PQL. Different
PQL statements will handle the appropriate view automatically. For
example, `Bitmap()` and `Profile()` will fetch using the `standard`
view or the `inverse` view, respectively. The `Range()` statement
will lookup the appropriate time-based views automatically.
2017-03-24 13:57:02 -06:00
Travis
75e12740d3 Merge branch 'master' into performance-enhancements 2017-03-07 15:07:21 -06:00
Travis
5f209cd063 first pass at merging the umbel-perf-improvements pass into master 2017-02-24 12:55:09 -06:00
Ben Johnson
7de0293034 Add basic schema support.
Databases and frames now require explicit creation and have the
option of setting row & column labels. If no labels are provided
then the default `id` and `profileID` labels are used.
2017-02-20 13:55:03 -07:00
Yuce Tekol
1eff86f78b Moved timestamp from HTTP query to PQL 2017-02-08 16:04:19 +03:00
Travis
d0bdea11c5 use the Build parameter as the Version in handler
Standardize on `Version` for the build version
2017-02-02 12:08:03 -06:00
Travis
1e816b401c Adds Todd's performance improvements:
- Ingore asserts in fragment container.
- Only log queries that take longer than 90 seconds.

TODO:
- address the TODOs that make the asserts configurable.
2017-01-27 13:16:27 -06:00
Cody Soyland
225bddc2a8 Add handler endpoint to get list of cluster nodes 2017-01-04 15:03:55 -06:00
Ben Johnson
7a91cbdd6d Add timestamps to import/sort.
The HTTP API, client, and `pilosactl` have been updated to allow
for a timestamp formatted using the pilosa date format of
`YYYY-MM-DDTHH:MM`.
2016-12-20 10:36:33 -07:00
Travis
659db70a57 Fixes merge conflicts related to MaxSlices.
Merge branch 'time' of github.com:benbjohnson/pilosa into benbjohnson-time
2016-12-12 09:04:23 -06:00
Ben Johnson
c6e2b1294b Add time-based frames and Range() support. 2016-12-08 12:29:49 -07:00
Travis
dd6f41f551 standardizes on MaxSlice (instead of SliceN)
creates DB locally even if node doesn't have data for that DB
2016-11-30 12:59:17 -06:00
Travis
78666d6bba Merge branch 'master' into db-specific-slices 2016-11-29 11:59:41 -06:00
Cody Soyland
5206461d51 Migrate from Umbel to Pilosa organization on Github 2016-11-28 15:21:11 -06:00
Travis
b6f0a62fdd changes MaxSlices logic to be DB-specific 2016-11-21 16:12:30 -06:00
Ben Johnson
8f78f854dd Add context to Client, Executor, & Handler.
This changes the API of the types but does not alter the functionality
since only the `context.Background()` is currently being used. Adding
`Context` will help handle fault tolerance in the future by allowing
timeouts to be propagated across calls to different nodes.
2016-11-10 13:37:00 -07:00
Ben Johnson
56aea09ce1 Add endpoint for database deletion.
Executing a request against `DELETE /db` will now delete a database.

	curl -X DELETE "http://localhost:15000/db" -d '{"db":"d"}'
2016-10-04 09:40:59 -06:00
Ben Johnson
d5ad5fbb05 Add profile & bitmap attribute anti-entropy.
Adds block-based anti-entropy for the attribute stores and hooks
into the existing `IndexSyncer` to regulate frequency of syncs.
2016-09-30 11:47:43 -06:00
Ben Johnson
39e0d22598 Add export command to pilosactl
CSV exports can now be done with the pilosactl application:

	$ pilosactl -d mydb -f myframe -o MYFILE.csv

If `-o` is not specified then the CSV is written to STDOUT. The
exporter combines all slices for the db/frame to into a single
concatenated CSV file.
2016-08-30 16:18:12 -06:00
Ben Johnson
96680a262c add http trace profiling 2016-08-12 10:58:45 -06:00
Todd Gruben
a2187b968c added info to owns fragrment error message 2016-06-10 10:19:54 -05:00
Todd Gruben
afb40fe8ef fixed typo 2016-06-07 15:29:28 -05:00
Todd Gruben
b40b2ff5ca Merge branch 'master' of github.com:umbel/pilosa 2016-06-07 15:25:42 -05:00
Todd Gruben
dab399e328 added logging on import;crashing bug on sync on empty fragment 2016-06-07 15:25:37 -05:00
Ben Johnson
14627a2152 use db in fragment allocation
This commit changes the fragment allocation algorithm in the cluster
to make use of the `DB` name. This allows each database to use a
different slice distribution.

Initially, the `frame` was going to be used for allocation, however,
this was problematic since queries can span multiple frames so it's
impossible to choose a single frame to use.
2016-06-07 14:01:13 -06:00
Ben Johnson
de698aa03e consensus block merge
This commit refactors the anti-entropy system to fetch data from
all replicated blocks and only set/clear bits which deviate from
the consensus between all blocks.

An example of this is if 3 nodes had the following bits set for
a single bitmap:

	Node A: 1 2 3
	Node B:   2   4
	Node C: 1 2   4

Then only bits which are set on a majority will be set. In this
case bits 1, 2, & 4 are set but 3 only exists on a single node.

The node performing the merge would then determine the following
set/clear diffs for each node:

	Node A: clear(3), set(4)
	Node B: set(1)
	Node C: none

Once the merge is performed and all nodes receive their diff
instructions then the nodes will be in sync:

	Node A: 1 2 4
	Node B: 1 2 4
	Node C: 1 2 4

There still exists situations where bits can be reset. If Node A
is up and Node B & C are down then Node A's bits will be reset
once B & C come back online. We should add write consistency
settings for incoming writes so that we can ensure that a quorum
is written to before returning a success. This is outside the
scope of this commit though.
2016-05-06 16:19:10 -06:00
Todd Gruben
b565271f94 made Bitmap SetBit method public 2016-04-19 09:22:42 -05:00
Ben Johnson
8f4d7d50c3 active anti-entropy
This commit adds active anti-entropy via a merkle tree structure.
2016-04-12 19:48:32 -06:00
Ben Johnson
26fd00ff3e add 'pilosactl bench' command
This commit adds a simple benchmarking utility to the `pilosactl`
binary. It currently only supports individual `SetBit()` commands
but it's a good start towards making a generic benchmarking
framework at the integration level.

The subcommands and usage/help messages were also cleaned up to
output correctly.
2016-03-31 15:49:57 -06:00
Ben Johnson
c51a17cfc6 add schema endpoint
This commit adds a new HTTP handler to return a list of all databases
and frames in the index:

	GET /schema

This returns JSON in the following format:

	{
	  "dbs":[
	    {
	      "name":"d0",
	      "frames":[
	        {"name":"f0"},
	        {"name":"f1"}
	      ]
	    }
	  ]
	}

Fixes #61
2016-03-22 11:25:52 -06:00
Ben Johnson
0ab4ee6f07 add frame restore for cluster transfer
This commit adds an endpoint to restore an entire frame from
another cluster. Multiple hosts can use this endpoint to copy
and rebalance a cluster to a new cluster.
2016-03-15 14:42:42 -06:00
Ben Johnson
569bafdc7d add bulk call support to the query endpoint
This commit changes the `pql.Query` so that it can accept one or more
top-level calls instead of only one.

The query request format change because a query with a single call is
still valid. However, the result format now returns a `results` field
that has one result for each top-level call. The `profiles` field is
still the same, however, it combines all profiles from all bitmap
responses into one return so that there's not duplicate attributes.

Fixes #59
2016-03-08 14:34:37 -07:00
Ben Johnson
5a63a14742 refetch full counts for TopN()
This commits adds refetching to get the actual TopN() count
after the top bitmaps are determined.

Fixes #57
2016-03-03 13:03:20 -07:00
Ben Johnson
5d79555d3e add backup/restore to pilosactl
This commit adds two commands:

    pilosactl backup
    pilosactl restore

The `Client` implementations have also been added to support these
commands:

    func (c *Client) BackupTo(w io.Writer, db, frame string) error
    func (c *Client) RestoreFrom(r io.Reader, db, frame string) error

Backups occur on a per-frame basis and all slices from the cluster
are packed into a single tar file. The backup tool attempts to
read from owner nodes in a random order and will retry against
the next owner if one fails.

During restore, the slices are restored to all owner nodes. This
allows users to backup a frame from one cluster and restore it
to a different one -- even if the topology of the new cluster is
different.
2016-02-29 08:38:24 -07:00
Todd Gruben
7c33b7fcf2 merge 2016-02-26 12:13:03 -06:00