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

Clean up obsolete code in BlockBasedTable::PrefetchIndexAndFilterBlocks #13277

Conversation

mszeszko-meta
Copy link
Contributor

@mszeszko-meta mszeszko-meta commented Jan 7, 2025

Summary:

As advertised and recommended by original authors comment, we're removing the now-outdated special handling logic for bloom filters perf regression (timing ~release 7.0.X). I decided to keep the CompatibilityName as-is since 1) it's publicly exposed API and 2) it's generally useful to have a dedicated name used for identifying whether a filter on disk is readable by the FilterPolicy.

Test Plan

'Dead code' / tech debt. As a smoke test, I manually run a similar benchmark to the one in #9736, with ./db_bench built pre and post change.

Generate DB:

./db_bench -db=/dev/shm/rocksdb.9.11 -bloom_bits=10 -cache_index_and_filter_blocks=1 -benchmarks=fillrandom -num=10000000 -compaction_style=2 -fifo_compaction_max_table_files_size_mb=10000 -fifo_compaction_allow_compaction=0

Before removing the 'if' block:

./db_bench -db=/dev/shm/rocksdb.9.11 -use_existing_db -readonly -bloom_bits=10 -benchmarks=readrandom -num=10000000 -compaction_style=2 -fifo_compaction_max_table_files_size_mb=10000 -fifo_compaction_allow_compaction=0 -duration=10 2>&1 | grep micros/op

readrandom   :      17.216 micros/op 58085 ops/sec 10.002 seconds 580999 operations;    4.1 MB/s (367256 of 580999 found)

After removing the 'if' block:

./db_bench -db=/dev/shm/rocksdb.9.11 -use_existing_db -readonly -bloom_bits=10 -benchmarks=readrandom -num=10000000 -compaction_style=2 -fifo_compaction_max_table_files_size_mb=10000 -fifo_compaction_allow_compaction=0 -duration=10 2>&1 | grep micros/op

readrandom   :      16.776 micros/op 59607 ops/sec 10.015 seconds 596999 operations;    4.2 MB/s (377846 of 596999 found)

@facebook-github-bot
Copy link
Contributor

@mszeszko-meta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@jaykorean
Copy link
Contributor

PR generally looks good to me. Could you add a release note for this change? I think it's important for users to know in case someone upgrades from a very old version of RocksDB < 7.0.x to the version having this change.

https://github.com/facebook/rocksdb/blob/main/unreleased_history/README.txt should have the instruction for the release note.

@facebook-github-bot
Copy link
Contributor

@mszeszko-meta has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@mszeszko-meta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@mszeszko-meta
Copy link
Contributor Author

PR generally looks good to me. Could you add a release note for this change? I think it's important for users to know in case someone upgrades from a very old version of RocksDB < 7.0.x to the version having this change.

https://github.com/facebook/rocksdb/blob/main/unreleased_history/README.txt should have the instruction for the release note.

Done!

Copy link
Contributor

@jaykorean jaykorean 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 may want to check with @pdillinger in case I am missing any other context for this change.

@@ -0,0 +1 @@
Clean up obsolete fix in `BlockBasedTable::PrefetchIndexAndFilterBlocks` isolated to early 7.0.x releases.
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this will be part of the upcoming major release (10.0). Typically, users pay closer attention to major release upgrades, so it might not be essential to emphasize this. However, it could still be beneficial to highlight that users should be aware of potential performance regressions when upgrading from versions prior to 7.0. They might have filter policy aliases created before 7.0 that will no longer be recognized due to this cleanup.

Copy link
Contributor

@pdillinger pdillinger left a comment

Choose a reason for hiding this comment

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

Thanks for the cleanup!

@@ -0,0 +1 @@
Clean up obsolete fix in `BlockBasedTable::PrefetchIndexAndFilterBlocks` isolated to early 7.0.x releases.
Copy link
Contributor

@pdillinger pdillinger Jan 8, 2025

Choose a reason for hiding this comment

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

FWIW, I disagree with release noting this. We know from experience that users have a tendency not to read release notes, so we need to be judicious about what is worthy of inclusion if we expect them to invest their time in reading them. Even if someone has a DB from version 7.0.0 - 7.0.2, it is still fully readable and compactable, just with degraded point read and prefix seek performance, because of lack of filtering.

If we keep a release note, it should talk about user impact of the (obscure case) behavior change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the release note.

@facebook-github-bot
Copy link
Contributor

@mszeszko-meta has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@mszeszko-meta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@mszeszko-meta mszeszko-meta force-pushed the prefetch_index_and_filter_blocks_cleanup branch from 47476fb to c631394 Compare January 8, 2025 23:57
@facebook-github-bot
Copy link
Contributor

@mszeszko-meta has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@mszeszko-meta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@mszeszko-meta merged this pull request in 44b741e.

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.

4 participants