HBASE-30062 Device layer simulator for MiniDFSCluster-based tests#8077
Open
apurtell wants to merge 1 commit intoapache:masterfrom
Open
HBASE-30062 Device layer simulator for MiniDFSCluster-based tests#8077apurtell wants to merge 1 commit intoapache:masterfrom
apurtell wants to merge 1 commit intoapache:masterfrom
Conversation
On EBS-backed deployments in AWS, or equivalents in other cloud infrastructure providers, HBase compaction and replication throughput can be constrained by per-volume IOPS limits rather than bandwidth. A faithful device-level simulator within the test harness allows developers to reproduce, analyze, and validate fixes for such performance issues without requiring actual cloud infrastructure. This proposed change adds a test-only EBS device layer that operates at the DataNode storage level within MiniDFSCluster by replacing the FsDatasetSpi implementation via Hadoop's pluggable factory mechanism. This allows HBase integration tests to simulate realistic cloud block storage characteristics, such as per-volume bandwidth budgets, IOPS limits, sequential IO coalescing, and per-IO device latency, enabling identification and reproduction of IO bottlenecks. The simulator wraps the real FsDatasetImpl with a java.lang.reflect.Proxy that intercepts the three FsDatasetSpi methods where DataNode local IO actually engages the underlying block device, without compile-time coupling to internal Hadoop classes. Each proxy gets its own set of EBSVolumeDevice instances with independent budgets. Block-to-volume resolution uses delegate.getVolume(block), providing real HDFS placement decisions. A single configuration applies to all volumes, but each volume maintains its own token buckets, matching production where all attached block devices to a host share the same SKU but have independent throughput budgets, and where the host itself has a cap on maximum aggregate throughput. EBS merges sequential IOs up to 1 MiB before counting them as a single IOPS token. The simulator tracks read streams and write streams independently. After each IOPS token consumption, the simulator sleeps for a configurable duration (default 1 ms), modeling physical device service time. IntegrationTestCompactionWithDeviceSimulator provides an end-to-end example of using the simulator.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On EBS-backed deployments in AWS, or equivalents in other cloud infrastructure providers, HBase compaction and replication throughput can be constrained by per-volume IOPS limits rather than bandwidth. A faithful device-level simulator within the test harness allows developers to reproduce, analyze, and validate fixes for such performance issues without requiring actual cloud infrastructure.
This proposed change adds a test-only EBS device layer that operates at the DataNode storage level within
MiniDFSClusterby replacing theFsDatasetSpiimplementation via Hadoop's pluggable factory mechanism. This allows HBase integration tests to simulate realistic cloud block storage characteristics, such as per-volume bandwidth budgets, IOPS limits, sequential IO coalescing, and per-IO device latency, enabling identification and reproduction of IO bottlenecks.The simulator wraps the real
FsDatasetImplwith ajava.lang.reflect.Proxythat intercepts the threeFsDatasetSpimethods where DataNode local IO actually engages the underlying block device, without compile-time coupling to internal Hadoop classes.Each proxy gets its own set of
EBSVolumeDeviceinstances with independent budgets. Block-to-volume resolution usesdelegate.getVolume(block), providing real HDFS placement decisions. A single configuration applies to all volumes, but each volume maintains its own token buckets, matching production where all attached block devices to a host share the same SKU but have independent throughput budgets, and where the host itself has a cap on maximum aggregate throughput.EBS merges sequential IOs up to 1 MiB before counting them as a single IOPS token. The simulator tracks read streams and write streams independently.
After each IOPS token consumption, the simulator sleeps for a configurable duration (default 1 ms), modeling physical device service time.
IntegrationTestCompactionWithDeviceSimulatorprovides an end-to-end example of using the simulator