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.
This allows the new write path to be hooked up if you start the
server with `INFLUXDB_ALPHA1=1`. When set, writes will go though
the coordinator and be stubbed out to write to a single local data
node with one shards. The write will be logged and written to
disk .
The env var is used so that the current write path is not completely
broken which would break many of the tests that depend on writes.
Note that queries are not currently working w/ the this change.
Given a WritePointsRequest, MapShards will return a map
of shard ID to points. This map can then be used to write
each point to the respective shard owners.
With this change heartbeating to the brokers will always communicate the
index of the most recently replicated message. This will allow broker
truncation and broker diagnostics to operate correctly.
This fixes a race detected by the race detector. "Create shard groups"
commands must be broadcast across the cluster without holding the server
lock so the commands are created under lock, and then processed after
releasing the lock.
This change means that lock control can use the defer call, which means
there is no chance the RLock will be left locked at function exit
Previously this code was more complex as it managed locks manually,
since the RLock must be released to allow the "drop series" broadcast
message go through.
With this change a datanode can stream the requested shard to the
client. An error is returned if the shard does not exist or the the
shard is not local to that node.
1 data node can hit this endpoint to request data for a given shard if
the data no longer resides on the broker.