Skip to content

HBASE-30062 Device layer simulator for MiniDFSCluster-based tests#8077

Open
apurtell wants to merge 1 commit intoapache:masterfrom
apurtell:HBASE-30062
Open

HBASE-30062 Device layer simulator for MiniDFSCluster-based tests#8077
apurtell wants to merge 1 commit intoapache:masterfrom
apurtell:HBASE-30062

Conversation

@apurtell
Copy link
Copy Markdown
Contributor

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

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.
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.

1 participant