Skip to content

[feat][cli] Add fault scenario controls to pulsar-perf#28

Open
Denovo1998 wants to merge 1 commit into
masterfrom
pulsar-perf-fault-scenarios
Open

[feat][cli] Add fault scenario controls to pulsar-perf#28
Denovo1998 wants to merge 1 commit into
masterfrom
pulsar-perf-fault-scenarios

Conversation

@Denovo1998

Copy link
Copy Markdown
Owner

Fixes #xyz

Main Issue: #xyz

PIP: #xyz

Motivation

pulsar-perf is useful for generating producer, consumer, and reader traffic during performance tests and operational drills. However, it cannot currently model several common client-side production failure patterns directly, such as consumers that receive messages but do not ack, consumers that ack slowly after per-message processing delay, fixed-key partition hot spots, or producer pending-queue behavior that fails instead of blocking.

This PR adds these client-side controls to the existing produce and consume commands so operators can reproduce those scenarios with pulsar-perf instead of writing one-off custom clients. The default behavior remains unchanged.

Modifications

  • Add --message-key to pulsar-perf produce to publish all messages with a fixed key for key-skew and hot-partition simulations.
  • Add --message-routing-mode to pulsar-perf produce, supporting RoundRobinPartition and SinglePartition, while rejecting unsupported CustomPartition usage from the CLI.
  • Add --block-if-queue-full to pulsar-perf produce, defaulting to the existing blocking behavior and allowing failure-oriented pending-queue simulations when set to false.
  • Add --ack-mode, --processing-delay-millis, and --ack-timeout-millis to pulsar-perf consume to support normal ack, no-ack, slow-ack, and ack-timeout redelivery simulations.
  • Keep existing default producer routing, producer pending-queue behavior, and consumer ack behavior unchanged unless the new options are explicitly configured.
  • Add tests for fixed-key production, producer option validation, producer builder defaults and overrides, consumer option validation, ack-timeout builder configuration, and no-ack unacked-message behavior.

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

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