Fixes#414. All series metadata, that is which series exist, what columns they have, and what the ids of those columns has been moved into Raft.
This means that list series queries are now very fast since they operate on an in memory data structure. It also means that writes no longer have to do gets agains the storage engine to resolve what a column's id is.
Fixes#358. List series now returns as a single series with a `name` column.
This fix has the potential to slow things down in scenarios that people suddenly write many thousands of new series in less than a second. That's because the definition of new series now needs to go through the raft leader and get consensus. I think it's unlikely that it'll be a problem, but we'll need to do extensive testing.
Finally, there is the issue that the Raft snapshots can potentially become big. We should do testing with setups that have millions of series to ensure that performance and startup time remain good.
The build process was originally hard coded to use /tmp but some
systems mount /tmp with noexec, causing the build to fail. This
change allows the user (optionally) to specify a tmp dir. E.g.,
TMPDIR=~/tmp make
This commit create a storage engine interface and modify shards to use
interface instead. It also adds a B-Tree implementation and benchmark
tool to compare the performance of the different storage engines.
Thanks to @freeformz for noticing this bug. Previously reconnect()
acquired a lock on entry, but that didn't protect us from a situation
where reconnect() is called twice in a row. The first time, a new
connection will be established but the second call will disconnect this
connection and open a new one. This can cause unexpected results since
the request sent on the first connection may not get a chance to receive
a response before the second call to reconnect() closes the connection.