Commit Graph

306 Commits (c665c749fe0aeb858ca2f059991826c923348949)

Author SHA1 Message Date
Jason Wilder 9046244df3 Remove the shard references when database is dropped
The shards map still held a reference to a shard that was dropped
which caused the periodic mainteance task to report errors continuously.
2015-10-26 13:04:57 -06:00
Philip O'Toole 6d38559f24 RLock access to store's shards
Fix issue #4442.
2015-10-13 20:28:19 -07:00
Jason Wilder 41e3294d4a Fix panic: assignment to entry in nil map
Closing the store did not properly return an error for in-flight
writes because the closing channel was set to nil when closed.  A
nil channel is not selectable so writes continue on past the guard
checks and trigger panics.
2015-10-06 14:03:52 -06:00
Jason Wilder ab791ba913 Fix TestStoreOpenShardCreateDelete
Shard path can be a directory.
2015-10-05 20:09:56 -04:00
Paul Dix 0b33a71bb7 Add recover to maintenance. Change snapshot writer to not use bolt on shard. 2015-10-05 20:06:22 -04:00
Paul Dix 1c8eac1523 Add PerformMaintenance to store for flushes and compactions.
Also fixed shard to work again with b1 and bz1 engines.
2015-10-05 20:06:22 -04:00
Ben Johnson 8e27cf1fd8 Merge remote-tracking branch 'upstream/master' into refactor-select-mapper
Conflicts:
	tsdb/store.go
2015-09-22 13:58:24 -06:00
Ben Johnson 1b8b625787 refactor SelectMapper 2015-09-22 13:09:26 -06:00
David Norton 8bd2408320 convert SHOW TAG KEYS to distributed query 2015-09-21 11:30:51 -04:00
Cory LaNou d19a510ad2 refactor Points and Rows to dedicated packages 2015-09-16 15:33:08 -05:00
Philip O'Toole 255fb3364d Don't close nil channel
Obviously a TSDB store may be closed before it's opened.
2015-09-08 10:49:45 -07:00
Jason Wilder 6b2b29625d Ensure the tsdb.Store is not closed before creating a shard
Fixes panic: assignment to entry in nil map

Fixes #3848
2015-09-08 11:04:00 -06:00
Jason Wilder 6b4926257a Add inspect tool
Start of a lower-level file inspection tool.  This currently dumps
summary statistics for the shards, index and WAL that can be used to
understand the shape of the data is in the local shards.  This util
operates on the shards itself and not through the server and is intended
more for debugging/troubleshooting.
2015-09-04 10:38:59 -06:00
Jason Wilder f72fd247b5 Fix panic when querying against non-fully replicated shards
The TSDBStore was returning a nil mapper if the shard did not exist.  The caller always
assumed the mapper would not be nil causing a panic.  Instead, have the mapper skip the mapping
phase if it's shard reference is nil.  This fixes queries against data-only nodes and against
shards that are not fully replicated in the cluster.

Fixes #3574
2015-08-31 10:03:07 -06:00
David Norton 88f556af72 convert SHOW MEASUREMENTS to a distributed query 2015-08-23 23:09:51 -04:00
Paul Dix 73f3dc1e14 Update store to properly manage WAL create/delete.
* Update the store to remove the WAL directories associated with a shard or database when they are deleted.
* Fix the Store so that it creates separate WAL directories for databases and retention policies.
2015-08-21 11:22:04 -04:00
Paul Dix 9df3b7d828 Add WAL configuration options 2015-08-18 16:59:54 -04:00
Paul Dix 3348dab4e0 Fix bug with new shards not getting series data persisted. 2015-08-16 15:45:09 -04:00
Jason Wilder 668181d275 Make log statements more consistent
* Capitalize first letter of message
* Log all services staring consistently
* Remove some extraneous log statements in meta.Store
* Log data dirs for meta, data and hinted handoff
2015-08-13 10:01:42 -06:00
Daniel Morsing 65ea56ae2c check error when opening shard DBs.
This should catch the case where someone messed up the permisssions
for a database that they moved from one machine to another.
2015-08-10 09:31:22 -07:00
Ben Johnson cc0607a5cf remove Engine.Flush() 2015-07-22 11:08:10 -06:00
Ben Johnson a7f50ae03c refactor storage to engine 2015-07-22 11:08:10 -06:00
Ben Johnson de1f9a3736 refactor tsdb tests into test package 2015-07-22 11:07:06 -06:00
Philip O'Toole 3695ebcd4e Move to a single LocalMapper type 2015-07-18 16:10:12 -07:00
Philip O'Toole 0d6c6bbe6f Correctly check if raw derivative is required
The multiple checks for Mapper and Executor type -- the lack of DRYness
in this code -- meant the same checks would need to be copied. Therefore
this change, as well as fixing the bug, improves the situation a little
bit by *asking* the Mappers what type of Executor is required. This code
is still not ideal.

Fixes #3355.
2015-07-16 23:28:38 -07:00
Philip O'Toole d8c31f0b3c Merge pull request #3320 from influxdb/streaming_dq
Support Distributed Queries
2015-07-16 12:33:21 -07:00
Philip O'Toole 74cb96646c Refactor query engine for distributed query support
With this change, the query engine code gathers information about
shards and tagsets by working with individual shards, collating the
information, and returning that to the client. It does not assume that any
particular shard is local, and accesses all shards through abstracted
Mappers, of which there are two types -- a Mapper type for Raw queries
and a second type for Aggregate queries. There are corresponding
Executors for each type of Mapper, but both types of Executors share the
same interface.
2015-07-15 12:54:55 -07:00
Philip O'Toole 09d7dfbaae Form database path correctly on DROP DATABASE
Fixes #3330
2015-07-15 11:14:49 -07:00
Philip O'Toole 7a87fbc58a Flush WAL as fast as possible on start-up
This addresses complaints of long start-up times when there is lots of
data sitting in the WAL.
2015-07-08 17:14:28 -06:00
Philip O'Toole ca86fa2633 Allow WAL inter-flush time to be configurable 2015-07-02 10:40:26 -04:00
Ben Johnson b574e2f755 Add write ahead log
This commit adds a write ahead log to the shard. Entries are cached
in memory and periodically flushed back into the index. The WAL and
the cache are both partitioned into buckets so that flushing doesn't
stop the world as long.
2015-06-25 15:47:13 -06:00
Philip O'Toole 01700f79b0 On DROP DATABASE remove from TSDB index 2015-06-22 11:44:46 -07:00
Ben Johnson bc31783a00 Refactor backup and restore
This commit updates the snapshot code as well as the "backup" and
"restore" command to work with the new architecture.
2015-06-10 22:07:01 -06:00
Philip O'Toole 6d26f9c8a8 Merge pull request #2856 from influxdb/rv_fixes
Series was not already dropped, return false (and other fixes)
2015-06-10 20:57:46 -07:00
Jason Wilder 67d4ef0e28 Don't queue write failures that due to type conflicts
These will never succeed and will stay in the queue indefinitely.
2015-06-10 14:52:59 -06:00
Philip O'Toole bc68afbe85 Fix minor spelling mistake 2015-06-09 14:35:38 -07:00
Philip O'Toole ca9f231fa1 Merge pull request #2776 from influxdb/enforce_retention_2_phase
Enforce retention policies
2015-06-05 11:15:21 -07:00
Paul Dix 4ba7c5d1c1 Merge pull request #2787 from influxdb/pd-drop-database
Wire up DROP DATABASE query
2015-06-05 20:09:06 +02:00
Paul Dix 70e10b136e Wire up DROP DATABASE query. 2015-06-05 12:31:04 -04:00
Philip O'Toole 81ec7353ce TSDB store can return all known Shard IDs 2015-06-04 17:02:22 -07:00
Paul Dix 55e0de30bd Merge pull request #2773 from influxdb/pd-locking
Ensure proper locking of index structures on writes and queries.
2015-06-04 19:50:49 -04:00
Philip O'Toole 5ea2042356 Add DeleteShard to TSDB store 2015-06-04 12:22:38 -07:00
Paul Dix 408bc3f81e Ensure proper locking of index structures on writes and queries. 2015-06-04 14:50:32 -04:00
Paul Dix 99446786f9 Merge pull request #2752 from influxdb/pd-drop-measurement
Wire up DROP MEASUREMENT
2015-06-03 14:02:37 -04:00
Cory LaNou be91c40b9a fix data race in WriteToShard 2015-06-03 11:46:18 -06:00
Paul Dix 9c4da3002c Wire up DROP MEASUREMENT
* Add deleteMeasurement to store and shard
* Add DropMeasurement to DatabaseIndex
* Update ErrMeasurementNotFound and ErrDatabaseNotFound to not include the first line of the stack trace.
2015-06-03 11:32:50 -04:00
Paul Dix c098c6fd78 Merge pull request #2728 from influxdb/pd-tsdb-drop-queries
Wire up DROP SERIES.
2015-06-02 11:30:49 -04:00
Paul Dix 4a1ce77090 Wire up DROP SERIES.
* Pulled over updates to ast and parser from master
* Updated store and shard to be able to drop series
* Pulled updates to database.go from master into tsdb/meta.go
2015-06-02 11:20:20 -04:00
Ben Johnson c916256ac9 Rename cluster.Writer to cluster.ShardWriter. 2015-05-30 14:05:27 -06:00
Paul Dix 15d37fd388 Make store open every shard on load. Fix shard to set measurementFields on load.
Fixes issue where queries wouldn't be able to hit anything because the index does't load until the shard is open.

Fix an issue where field codecs weren't populated in the shard when loading.
2015-05-30 11:53:53 -04:00
Paul Dix f660b1a3d3 Create QueryExecutor in tsdb. 2015-05-29 14:59:57 -06:00
Paul Dix 072dacc1ab Update tx.go to work with tsdb 2015-05-29 14:59:57 -06:00
Ben Johnson 75ab63b538 Refactor meta statement execution to meta.StatementExecutor. 2015-05-29 14:54:04 -06:00
Jason Wilder 85f59d696b Create and open shards on-demand
Uses a structure like:

  /root/
      /db1/rp1/1
              /2
      /db2/rp2/3

If a write is assigned to a shard on the local node but the shard
has not been created, create it when the write returns an error
and retry the write.
2015-05-26 16:38:45 -06:00
Jason Wilder 7ace10f7e6 Load shards from filesystem when tsdb.Store is opened 2015-05-26 15:43:46 -06:00
Paul Dix 01618dc143 Move data.Node to tsdb.Store. Move data to cluster. 2015-05-26 15:56:54 -04:00