Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streaming inmem2tsi conversion. #8963

Merged
merged 3 commits into from
Oct 20, 2017

Conversation

benbjohnson
Copy link
Contributor

@benbjohnson benbjohnson commented Oct 13, 2017

Overview

Changes the influx_inspect inmem2tsi tool to stream each TSM/WAL file and convert to a TSI index instead of loading the entire shard's in-memory index first.

Required for all non-trivial PRs
  • Rebased/mergable
  • Tests pass
  • CHANGELOG.md updated
  • Update man page when modifying a command
  • InfluxData Documentation: issue filed or pull request submitted <link to issue or pull request>

@benbjohnson benbjohnson requested review from jwilder and e-dard October 13, 2017 19:44
@ghost ghost assigned benbjohnson Oct 13, 2017
@ghost ghost added the review label Oct 13, 2017
Copy link
Contributor

@e-dard e-dard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I got a bit confused about exactly what datadir and waldir should be. Maybe some clarification on the flag descriptions would help?

// Check if shard already has a TSI index.
indexPath := filepath.Join(path, "index")
indexPath := filepath.Join(dataDir, "index")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This confused me because in your flags section you have "data directory" and "wal directory", which I interpreted as ~/.influxdb/data and ~/.influxdb/wal. I guess by data and wal directories you mean the data and wal database directories?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added clarification in 22a0e42.

}

switch t := entry.(type) {
case *tsm1.WriteWALEntry:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will create an inconsistent index because it will index everything in the WAL when there could be deletes stored later. Maybe instead, use the CacheLoader to re-create a Cache and iterate over the keys that still remain in the cache?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I switched it to use the tsm1.CacheLoader instead in 22a0e42. Can you take a look?

@e-dard e-dard added this to the 1.4.0 milestone Oct 20, 2017
Changes the `influx_inspect inmem2tsi` tool to stream each TSM/WAL
file and convert to a TSI index instead of loading the entire shard's
in-memory index first.
@benbjohnson benbjohnson merged commit 6aaa772 into influxdata:master Oct 20, 2017
@benbjohnson benbjohnson deleted the streaming-inmem2tsi branch October 20, 2017 21:14
@ghost ghost removed the review label Oct 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants