Skip to content

fix(config): remove ineffective RocksDB table setters - #6944

Open
bladehan1 wants to merge 1 commit into
tronprotocol:developfrom
bladehan1:feature/remove_unverified_rocksdb_config
Open

fix(config): remove ineffective RocksDB table setters#6944
bladehan1 wants to merge 1 commit into
tronprotocol:developfrom
bladehan1:feature/remove_unverified_rocksdb_config

Conversation

@bladehan1

Copy link
Copy Markdown
Collaborator

What does this PR do?

Remove RocksDB block-table setters that were applied after setTableFormatConfig() and therefore never reached the native table factory.

Keep the existing storage.dbSettings.blocksize entries and Java API for compatibility, while documenting in reference.conf that the value is not currently applied to native RocksDB table options.

Add regression tests for the shipped Options-level configuration and the effective native block-table behavior.

Why are these changes required?

setTableFormatConfig() materializes the native table factory from the Java configuration at call time. The later block-size, shared-cache, index/filter-cache, L0-pinning, and Bloom-filter setters only changed the Java object and did not affect the native factory.

Moving those setters before setTableFormatConfig() would activate several unverified settings at once. In a fixed 500-block Mainnet replay, activating the combined settings reduced throughput from 2.421 blocks/s to 1.969 and 1.680 blocks/s, while restoring the pre-change effective native behavior produced 2.418 blocks/s.

This change therefore removes the ineffective setter sequence while preserving the behavior that nodes actually used before the change.

This PR has been tested by:

  • ./gradlew :common:test --tests org.tron.common.setting.RocksDbSettingsTest
  • ./gradlew :framework:test --tests org.tron.core.config.ConfigurationTest
  • ./gradlew :framework:checkstyleMain
  • ./gradlew :framework:checkstyleTest

Follow up

Evaluate block size, Bloom filters, shared-cache capacity, ownership, lifecycle, and observability independently with representative SR and database-specific workloads before enabling another RocksDB table profile.

Extra details

  • blocksize remains configurable and observable for compatibility but is not applied to the native table factory.
  • The existing static shared-cache object and accessor remain for separate configuration design and validation.
  • No API, protocol, database-format, or migration changes are introduced.

Closes #6939

RocksDB.loadLibrary();
}

private static final LRUCache cache = new LRUCache(1 * 1024 * 1024 * 1024L);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[SHOULD] cache is unused now, remove it ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The existing static shared-cache object and accessor remain for separate configuration design and validation.
This won't actually use 1GB of memory; it only incurs a small object overhead.

tableCfg.setCacheIndexAndFilterBlocks(true);
tableCfg.setPinL0FilterAndIndexBlocksInCache(true);
tableCfg.setFilter(new BloomFilter(10, false));
options.setTableFormatConfig(new BlockBasedTableConfig());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[NIT] Remove options.setTableFormatConfig(new BlockBasedTableConfig()); ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Retain an entry point for modifying the configuration; this is a change that will require separate verification in the future.

Preserve the shipped RocksDB configuration and public block-size API while removing table setters that never reached the native table factory. Document that blocksize is currently ineffective and verify native behavior.

Keep the existing shared cache object for separate configuration design and validation.

Closes tronprotocol#6939
@bladehan1
bladehan1 force-pushed the feature/remove_unverified_rocksdb_config branch from 14922c4 to 7f628d4 Compare September 2, 2026 07:48
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.

[Bug] RocksDB table option setters are ineffective in 4.8.2.1

2 participants