Both Shard and Engine had the same reference to the measurementField map,
but they each protected it with their own locks. This causes a race when
write and queries are occurring because writes can add new fields to the
map while queries are reading from it.
The fix moves the ownership to the Engine and provides protected accessors
to that Shard now users. For the most parts, the access on shard were old
dead code.
Fixing the measurementFields map race created a new race on the internal
fields map. This is now unexported and protected via MeasurementFields
exported funcs.
Fixes#6188
Some people (e.g. me!) use build-docker.sh to create docker images.
I got burnt by the go 1.5 performance issue because I didn't override
the default GO_VER variable.
This change sets the default to the same as used in the main build.
Signed-off-by: Jon Seymour <jon@wildducktheories.com>
If the http.CloseNotifier didn't go off for some reason (and it's not
guaranteed to go off just because the HTTP connection is closed), the
query wouldn't get correctly recycled when chunked output was requested.
The query id in the query executor was also not being set correctly.
This seems to have been an oversight when merging the point limit
monitor.
A bigger refactor of these functions is needed to support #3290, but
this will work for the more common case that someone uses double quotes
instead of single quotes when surrounding a time literal.
Fixes#3932.
The stats setup ends up creating a lot of lock contention which signifcantly
impacts write throughput when a large number of measurements are used.
Fixes#6131
This commit sets the `MergeIterator.init` flag after initialization.
Previously this would generate a new heap on every call to `Next()`
which caused some aggregate queries to slow by ~10,000%.
Writing a key that exceeds the max key length could cause a panic
when reading a tsm file because the 2 bytes used for the key length
would not be enough to represent the actual key length.
The writer will now return an error if when trying to write a key
that is too large.
This commit changes the timeout for `mux.Mux.handleConn()` to use
`time.Timer` instead of `time.After()` so that the channel can be
closed immediately once the connection is handed off.