Skip to content

Conversation

@woshigaopp
Copy link

add autobalancer demos

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds demonstration scripts and configurations for AutoMQ's auto-balancer feature. The changes include automation scripts for traffic-based and scale-up scenarios, Prometheus monitoring configurations, and example experiment results.

Key Changes:

  • Shell scripts for running auto-balancer experiments with various configurations
  • Prometheus configuration files for monitoring 2-broker and 3-broker setups
  • Experiment result logs and screenshots showing auto-balancer behavior

Reviewed changes

Copilot reviewed 91 out of 130 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
results/*.log Experiment output logs showing failed test runs (missing docker-compose files)
traffic-based/scripts/*.sh Multiple experiment and utility scripts for traffic-based auto-balancing demos
traffic-based/results/* Example screenshots and metrics from successful demo runs
traffic-based/prometheus*.yml Prometheus configurations for different broker counts
scale-up/scripts/*.sh Setup and verification scripts for scale-up demos

Note: I've reviewed the shell scripts and configuration files. The main concerns are around error handling, documentation, and the inclusion of log files showing failed experiments. The scripts appear functional but could benefit from improved error handling and clearer documentation in some areas.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +32 to +43
echo "partition-${PARTITION}:${PAYLOAD}" | docker exec -i automq-server1-traffic bash -c "
unset KAFKA_JMX_OPTS
/opt/automq/kafka/bin/kafka-console-producer.sh \
--bootstrap-server server1:9092 \
--topic $TOPIC \
--property 'parse.key=true' \
--property 'key.separator=:' \
--property 'partitioner.class=org.apache.kafka.clients.producer.UniformStickyPartitioner' \
--producer-property linger.ms=100 \
--producer-property batch.size=524288 \
--producer-property compression.type=lz4
" 2>&1 | grep -v "WARN" || true
Copy link

Copilot AI Jan 4, 2026

Choose a reason for hiding this comment

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

The generate-partition-load.sh script interpolates the TOPIC CLI argument directly into a double-quoted bash -c string (--topic $TOPIC), which is then executed inside the container. Because TOPIC comes from untrusted command-line input, a crafted value containing shell metacharacters (e.g., mytopic; rm -rf /) could break out of the intended kafka-console-producer.sh invocation and execute arbitrary commands in the container. To prevent command injection, avoid building shell command strings with unescaped user input (e.g., pass the topic as a separate argument to docker exec/bash, or strictly validate and escape TOPIC to allow only safe characters).

Copilot uses AI. Check for mistakes.
@johnluoyx
Copy link
Contributor

Hi @woshigaopp The file path may need to be organized. Specifically, whether this example is open-source software or BYOC mode, it needs to be placed in the corresponding folder.

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.

3 participants