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

Assert unlimited max_open_files for FIFO compaction. #8172

Conversation

thejchap
Copy link
Contributor

@thejchap thejchap commented Apr 10, 2021

Resolves #8014

  • Add an assertion on DB::Open to ensure db_options.max_open_files is unlimited if FIFO Compaction is being used.
  • This is to align with what the docs mention and to prevent premature data deletion.
  • Update tests to work with this assertion.

Test Plan:

$ make check -j$(nproc)

Generated TARGETS Summary:
- 6 libs
- 0 binarys
- 180 tests

@thejchap thejchap changed the title [WIP] Add assertion to ensure valid options combination for FIFO compaction. [WIP] Assert unlimited max_open_files for FIFO compaction. Apr 10, 2021
@thejchap thejchap force-pushed the bug/fifo-compaction-with-ttl-and-max-open-files-1 branch from 593c979 to 6f38b78 Compare April 10, 2021 16:20
Copy link
Contributor

@ajkr ajkr left a comment

Choose a reason for hiding this comment

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

Looks good so far. Do you mind also mentioning this under "Bug Fixes" section in the "HISTORY.md" file?

It looks like some tests relied on the now unsupported combination of options. You can try running make check -j$(nproc) locally (if that fails and it's not obvious what caused it, try make watch-log) to find all such cases.

@thejchap thejchap force-pushed the bug/fifo-compaction-with-ttl-and-max-open-files-1 branch 7 times, most recently from 756785a to a43af28 Compare April 13, 2021 23:59
Copy link
Contributor

@ajkr ajkr left a comment

Choose a reason for hiding this comment

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

Looks great!

Resolves facebook#8014
- Add an assertion on `DB::Open` to ensure `db_options.max_open_files` is unlimited if FIFO Compaction is being used.
- This is to align with what the docs mention and to prevent premature data deletion.
- Update tests to work with this assertion.

Test Plan:
'make check -j$(nproc)`
@thejchap thejchap force-pushed the bug/fifo-compaction-with-ttl-and-max-open-files-1 branch from a43af28 to fe19286 Compare April 14, 2021 17:21
@thejchap thejchap changed the title [WIP] Assert unlimited max_open_files for FIFO compaction. Assert unlimited max_open_files for FIFO compaction. Apr 14, 2021
@thejchap thejchap marked this pull request as ready for review April 14, 2021 17:31
@facebook-github-bot
Copy link
Contributor

@thejchap has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Comment on lines +1358 to +1359
if (cf_options.compaction_style == kCompactionStyleFIFO &&
db_options.max_open_files != -1 && cf_options.ttl > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain the ttl > 0? If ttl == 0, is it okay if max_open_files != -1 ?

Copy link
Contributor

Choose a reason for hiding this comment

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

As far as we know, the max_open_files == -1 is only needed to ensure the files' creation_time properties are read, which are used for deciding to trigger TTL compaction. When ttl == 0, TTL compaction is disabled.

@facebook-github-bot
Copy link
Contributor

@thejchap merged this pull request in d894830.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

creation time can not be read
4 participants