Panacea is an automated testing framework for detecting logic bugs in HTAP (Hybrid Transactional/Analytical Processing) database systems.
- Multiple Database Support: TiDB, PolarDB, TDSQL, MySQL, MySQL HeatWave
- Multiple Testing Modes:
htap-logic- HTAP logical consistency testinghtap-mixed- HTAP mixed workload testing
- Smart Deduplication: Structural query analysis-based error deduplication
- LLM Feedback: Optional LLM integration for test strategy optimization
- Concurrent Testing: Multi-threaded execution support
- JDK 11+
- Maven 3.6+
- Accessible target database instance(s)
mvn -DskipTests packageEdit a config file (e.g., config/tidb/config-tidb.yaml):
provider: tidb
base:
connections:
tidb-local:
host: 127.0.0.1
port: 4000
username: root
password: ''
defaultConnection: tidb-local
taskType: htap-logic# Use specific config file
java -jar target/panacea-0.1.0.jar --config config/tidb/config-tidb.yaml
# Or pass config path directly
java -jar target/panacea-0.1.0.jar config/tidb/config-tidb.yaml
# Use default config.yaml in current directory
java -jar target/panacea-0.1.0.jarprovider: tidb|polardb|tdsql|mysql
base:
# Testing mode
taskType: mysql|htap-logic|htap-mixed
# Database connections
connections:
<connection-name>:
host: <host>
port: <port>
username: <user>
password: <password>
# Execution parameters
threads: 1 # Concurrent threads
maxFailures: 100 # Max failure count
runtimeDuration: "1h" # Runtime duration (e.g., "30m", "2h")
logPath: ./logs # Log output pathdeduplication:
enabled: true
feedbackMode: local_only # local_only | llm_only
frequencyScope: global # run | globalllmFeedback:
enabled: false # Disabled by default
apiKeyEnv: OPEN_ROUTER_KEY
model: qwen/qwen3.5-flash-02-23When LLM is enabled, set the environment variable:
export OPEN_ROUTER_KEY=your_api_keyThe project provides several example configurations:
config/config.yaml- Generic config templateconfig/tidb/config-tidb.yaml- TiDB configconfig/tdsql/config-tdsql-enable.yaml- TDSQL config
After running, the following files are generated in the logPath directory:
logs_<timestamp>/- Current run log directory*.sql- SQL execution logsexceptions/- Exception informationllm_feedback.jsonl- LLM feedback records (if enabled)
decision_frequency.json- Decision frequency statistics (global mode)
MIT License - See LICENSE.md