influxdb/tsdb/tsm1
Jeff Wendling 0fae44e219 storage: fix problems with keeping resources alive
This commit adds the pkg/lifecycle.Resource to help manage opening,
closing, and leasing out references to some resource. A resource
cannot be closed until all acquired references have been released.
If the debug_ref tag is enabled, all resource acquisitions keep
track of the stack trace that created them and have a finalizer
associated with them to print on stderr if they are leaked. It also
registers a handler on SIGUSR2 to dump all of the currently live
resources.

Having resources tracked in a uniform way with a data type allows us
to do more sophisticated tracking with the debug_ref tag, as well.
For example, we could panic the process if a resource cannot be
closed within a certain time frame, or attempt to figure out the
DAG of resource ownership dynamically.

This commit also fixes many issues around resources, correctness
during error scenarios, reporting of errors, idempotency of
close, tracking of memory for some data structures, resource leaks
in tests, and out of order dependency closes in tests.
2019-02-28 10:22:01 -07:00
..
DESIGN.md Initial import of tsm1.Engine 2018-10-01 12:08:37 +01:00
array_cursor.gen.go refactor: move the tsm1/wal into the storage/wal package 2019-02-04 10:32:52 -07:00
array_cursor.gen.go.tmpl refactor: move the tsm1/wal into the storage/wal package 2019-02-04 10:32:52 -07:00
array_cursor.gen.go.tmpldata refactor: move the tsm1/wal into the storage/wal package 2019-02-04 10:32:52 -07:00
array_cursor_iterator.gen.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
array_cursor_iterator.gen.go.tmpl chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
array_cursor_iterator.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
array_encoding.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
array_encoding_test.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
batch_boolean.go Ensure error strings not capitalised ST1005 2018-11-30 10:54:24 +00:00
batch_boolean_test.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
batch_float.go feat(tsm1): Improve performance of Gorilla float block decoding 2018-11-01 18:59:20 +00:00
batch_float_test.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
batch_integer.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
batch_integer_test.go chore(storage,tsdb): fix megacheck errors 2018-11-01 12:54:46 -07:00
batch_string.go Ensure error strings not capitalised ST1005 2018-11-30 10:54:24 +00:00
batch_string_test.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
batch_timestamp.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
batch_timestamp_test.go feat(encoding): Improve timestamp encoding 2018-11-01 18:59:20 +00:00
bit_reader.go Initial import of tsm1.Engine 2018-10-01 12:08:37 +01:00
bit_reader_test.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
bool.go Ensure error strings not capitalised ST1005 2018-11-30 10:54:24 +00:00
bool_test.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
cache.go storage: respond to review comments 2019-02-04 12:26:26 -07:00
cache_race_test.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
cache_test.go tsm1: implement DeleteBucketRange for the Cache 2019-02-04 10:32:52 -07:00
compact.gen.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
compact.gen.go.tmpl chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
compact.gen.go.tmpldata Initial import of tsm1.Engine 2018-10-01 12:08:37 +01:00
compact.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
compact_test.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
config.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
encoding.gen.go refactor: move the tsm1/wal into the storage/wal package 2019-02-04 10:32:52 -07:00
encoding.gen.go.tmpl refactor: move the tsm1/wal into the storage/wal package 2019-02-04 10:32:52 -07:00
encoding.gen.go.tmpldata Initial import of tsm1.Engine 2018-10-01 12:08:37 +01:00
encoding.gen_test.go refactor: move the tsm1/wal into the storage/wal package 2019-02-04 10:32:52 -07:00
encoding.go refactor: move value aliases into its own file 2019-02-04 10:32:52 -07:00
encoding_test.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
engine.go storage: fix problems with keeping resources alive 2019-02-28 10:22:01 -07:00
engine_cursor.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
engine_delete_bucket.go storage: fix problems with keeping resources alive 2019-02-28 10:22:01 -07:00
engine_delete_bucket_test.go storage: fix problems with keeping resources alive 2019-02-28 10:22:01 -07:00
engine_test.go storage: fix problems with keeping resources alive 2019-02-28 10:22:01 -07:00
file_store.gen.go tsm1: DeletePrefix on the indirectIndex 2019-01-07 21:08:32 -07:00
file_store.gen.go.tmpl chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
file_store.gen.go.tmpldata Initial import of tsm1.Engine 2018-10-01 12:08:37 +01:00
file_store.go Feat/add zeros to tsm filename (#12174) 2019-02-27 14:59:38 -08:00
file_store_array.gen.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
file_store_array_test.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
file_store_key_iterator.go tsm1: fix remaining issues and add small benchmarks 2019-01-07 11:00:35 -07:00
file_store_key_iterator_test.go tsm1: change TSMFile to use an iterator style api 2019-01-07 11:00:35 -07:00
file_store_observer.go Initial import of tsm1.Engine 2018-10-01 12:08:37 +01:00
file_store_test.go Feat/add zeros to tsm filename (#12174) 2019-02-27 14:59:38 -08:00
float.go Ensure all tsm1 metrics support multiple instances 2018-12-07 14:32:34 +00:00
float_test.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
int.go Ensure error strings not capitalised ST1005 2018-11-30 10:54:24 +00:00
int_test.go Initial import of tsm1.Engine 2018-10-01 12:08:37 +01:00
metrics.go refactor: move the tsm1/wal into the storage/wal package 2019-02-04 10:32:52 -07:00
metrics_test.go refactor: move the tsm1/wal into the storage/wal package 2019-02-04 10:32:52 -07:00
mmap_unix.go Initial import of tsm1.Engine 2018-10-01 12:08:37 +01:00
mmap_windows.go Initial import of tsm1.Engine 2018-10-01 12:08:37 +01:00
reader.gen.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
reader.gen.go.tmpl chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
reader.gen.go.tmpldata Initial import of tsm1.Engine 2018-10-01 12:08:37 +01:00
reader.go tsm1: add initial index cleanup to DeletePrefix 2019-01-08 16:32:43 -07:00
reader_block_iterator.go tsm1: change TSMFile to use an iterator style api 2019-01-07 11:00:35 -07:00
reader_block_iterator_test.go tsm1: move code around into smaller files and add tests 2019-01-07 21:11:49 -07:00
reader_fault_buffer.go tsm1: move code around into smaller files and add tests 2019-01-07 21:11:49 -07:00
reader_index.go tsm1: add initial index cleanup to DeletePrefix 2019-01-08 16:32:43 -07:00
reader_index_iterator.go tsm1: fix remaining issues and add small benchmarks 2019-01-07 11:00:35 -07:00
reader_index_iterator_test.go tsm1: move code around into smaller files and add tests 2019-01-07 21:11:49 -07:00
reader_index_test.go tsm1: add initial index cleanup to DeletePrefix 2019-01-08 16:32:43 -07:00
reader_mmap.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
reader_offsets.go tsm1: DeletePrefix on the indirectIndex 2019-01-07 21:08:32 -07:00
reader_offsets_test.go tsm1: fix remaining issues and add small benchmarks 2019-01-07 11:00:35 -07:00
reader_prefix_tree.go tsm1: remove unsafe in prefixTree 2019-01-09 12:43:01 -07:00
reader_prefix_tree_test.go tsm1: add comments responding to review feedback 2019-01-09 11:35:06 -07:00
reader_test.go tsm1: add initial index cleanup to DeletePrefix 2019-01-08 16:32:43 -07:00
reader_time_range.go tsm1: add comments responding to review feedback 2019-01-09 11:35:06 -07:00
reader_time_range_test.go tsm1: move code around into smaller files and add tests 2019-01-07 21:11:49 -07:00
ring.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
ring_test.go Initial import of tsm1.Engine 2018-10-01 12:08:37 +01:00
scheduler.go Ensure all tsm1 metrics support multiple instances 2018-12-07 14:32:34 +00:00
scheduler_test.go Convert Cache statistics 2018-12-07 14:32:34 +00:00
stats.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
stats_test.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
string.go Ensure error strings not capitalised ST1005 2018-11-30 10:54:24 +00:00
string_test.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
timestamp.go Ensure error strings not capitalised ST1005 2018-11-30 10:54:24 +00:00
timestamp_test.go Initial import of tsm1.Engine 2018-10-01 12:08:37 +01:00
tombstone.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
tombstone_test.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
value.go storage: replay the WAL through the whole engine 2019-02-04 10:32:52 -07:00
writer.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
writer_test.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00