Avoids a panic if a series ID exists in the tsm file but not in the IDs file.
Also handles the case were we don't have an ids file and just a tsm file.
WaitForDataChanged is used to block a goroutine so it can be woken
up when the metastore has been updated. This makes it so clients
to the metastore do not need to poll the metastore repeatedly to
watch for changes. This was only working for local raft nodes, but
was supposed to work for remote nodes as well.
Since INTO queries need to have absolute information about the database
to work, we need to create a loopback interface back to the cluster
in order to perform them.
influx_inpsect uncovered some scenarios where timestamps could be stored using
run-length encoding but were being stored using simple8 which uses more space.
influx_inspect uncovered that the monitoring database was storing it's data with almost
no compression because it recorded points at nanosecond precision but spaced them 10s apart. This
still requires 8 bytes.
Instead, store the points at seconds precision which allows the timestamp data to be run-length
encoded.
This will read a tsm file and dump index, block and compression level info from the file.
It reads the file directly as opposed to reading it through the tsm engine which should
help with debugging and troubleshooting data file issues.
The implementation is not pretty but the output is very useful. In the future, we can
add data extraction, recovery and verification functionality if needed.
Everytime the purge check was running, a new segment was being added.
This meant the list of almost-empty files in the HH directories would
grow continually.
If DecodeSameTypeBlock is called on on an empty Values slice, it would
panic with an index out of bounds error. This func can actually be removed
because DecodeBlock can determine what type of values are encoded already.
This will still panic if the block cannot be decoded due to other reasons.
Fixes#4365