Refactored query engine to have different processing pipeline for raw queries. This enables queries that have a large offset to not keep everything in memory. It also makes it so that queries against raw data that have a limit will only p
rocess up to that limit and then bail out.
Raw data queries will only read up to a certain point in the map phase before yielding to the engine for further processing.
Fixes#2029 and fixes#2030
This sends data node urls via the broker heartbeat from each data
node. The urls are tracked on the broker to support simpler
cluster setup as well as distributed queries.
This commit adds incremental backup support. Snapshotting from the server
now creates a full backup if one does not exist and creates numbered
incremental backups after that.
For example, if you ran:
$ influxd backup /tmp/snapshot
Then you'll see a full snapshot in /tmp/snapshot. If you run the same
command again then an incremental snapshot will be created at
/tmp/snapshot.0. Running it again will create /tmp/snapshot.1.
This commit adds the "influxd restore" command to the CLI. This allows
a snapshot that has been produced by "influxd backup" to be restored
to a config location and the broker and raft directories will be
bootstrapped based on the state of the snapshot.
This commit adds the backup command to the influxd binary as well as
implements a SnapshotWriter in the influxdb package.
By default the snapshot handler binds to 127.0.0.1 so it cannot be
accessed outside of the local machine.
The pollForIndex method starts a goroutine to check the latest index
periodically. But when the HTTP request finishs, the loop is still there
and the goroutine never exits.
This leads to a memory leak and goroutine leak after each request to the
"/wait/:index" API.
The problem can be reproduced by ```ab -c 10 -t 30 http://127.0.0.1:8086/wait/1```.
After several times of benchmark you'll find that the memory usage grows markedly.
Signed-off-by: Shijiang Wei <mountkin@gmail.com>