소스 정보
- 저장소
- multigres/multigres
- 최근 소스 활동
- 2026년 7월 5일 06:15
- 감지된 SKILL.md 언어
- 영어
- 스타
- 2,616
- 포크
- 140
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
SOC 직업 분류 기준
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/multigres/multigres --skill development-tools명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
Manage local multigres cluster components (multipooler, pgctld, multiorch, multigateway) - start/stop services, view logs, connect with psql, test S3 backups locally
Generate a PR title and description from the current branch diff against main
Fix markdown linting and prettier formatting issues in markdown files
| name | Development Tools |
| description | Run unit tests, integration tests, and development tasks for multigres |
Development commands for the multigres project.
/mt-dev [test-type] [args...]
When executing commands:
make build before integration testsscripts/portpool.sh start (idempotent, safe to call every time). Then prefix the go test command with MULTIGRES_PORT_POOL_ADDR=/tmp/multigres-port-pool.sock to coordinate port allocation and avoid flaky collisions. If the socket already exists (e.g. from a previous session), just set the env var — no need to restart.Unit tests are fast, isolated tests for individual functions and packages. They don't require external services or build artifacts.
Note: plain go test ./go/... will also traverse go/test/endtoend/...; use -short for unit-focused runs.
Run all unit tests:
/mt-dev unit all
Executes: go test -short ./go/...
Run specific package:
/mt-dev unit <package-path>
Examples:
/mt-dev unit ./go/services/multipooler/... - All multipooler package tests/mt-dev unit ./go/multigateway/... - All multigateway package tests/mt-dev unit ./go/pgprotocol/... - All pgprotocol package testsRun specific test:
/mt-dev unit <package-path> <TestName>
Examples:
/mt-dev unit ./go/services/multipooler TestConnectionPool/mt-dev unit ./go/pgprotocol TestParseQueryRun with pattern matching:
/mt-dev unit <package-path> <TestPattern>
Examples:
/mt-dev unit ./go/services/multipooler TestConn.* - All tests starting with TestConn/mt-dev unit ./go/multigateway Test.*Route.* - All tests with "Route" in name-v - Verbose output (shows all test names as they run)-race - Enable race detector (slower, catches concurrency bugs)-cover - Show coverage percentage-coverprofile=coverage.out - Generate coverage report-count=N - Run tests N times (useful for flaky test detection); -count=1 also forces re-run and bypasses test cache-timeout=30s - Set timeout (default: 10m)-short - Skip long-running tests-parallel=N - Run N tests in parallel (default: GOMAXPROCS)# Quick test run
/mt-dev unit all
# Verbose with race detection
/mt-dev unit ./go/services/multipooler/... -v -race
# Coverage report
/mt-dev unit ./go/pgprotocol/... -cover
# Test for flakiness
/mt-dev unit ./go/multigateway TestRouting -count=10
# Fast tests only
/mt-dev unit all -short
# Specific test with verbose output
/mt-dev unit ./go/services/multipooler TestConnectionPool -v
/mt-dev unit all/mt-dev unit ./go/services/multipooler/.../mt-dev unit ./go/services/multipooler TestConnectionPool/mt-dev unit all -cover/mt-dev unit ./go/multigateway/... -raceIntegration tests are end-to-end tests that start real components (Multigateway, Multipooler, PostgreSQL) and test their interactions. These tests are slower and require building the project first.
IMPORTANT: Integration tests always run make build first.
all - Run all integration testsmultipooler - Connection pooling, pool lifecycle, connection managementmultiorch - Orchestration, failover, leader election, consensus protocolqueryserving - Query routing, execution, transaction handlinglocalprovisioner - Local cluster provisioning and setupshardsetup - Shard configuration and managementpgregresstest - PostgreSQL regression tests (opt-in, comprehensive)Run all integration tests:
/mt-dev integration all
Executes: make build && go test ./go/test/endtoend/...
Run specific package:
/mt-dev integration <package-name>
Examples:
/mt-dev integration multipooler → make build && go test ./go/test/endtoend/multipooler/.../mt-dev integration multiorch → make build && go test ./go/test/endtoend/multiorch/.../mt-dev integration queryserving → make build && go test ./go/test/endtoend/queryserving/...Run specific test:
/mt-dev integration <package-name> <TestName>
Examples:
/mt-dev integration multiorch TestFixReplication → make build && go test -run TestFixReplication ./go/test/endtoend/multiorch/.../mt-dev integration multipooler TestConnCache → make build && go test -run TestConnCache ./go/test/endtoend/multipooler/...Run specific test in all packages:
/mt-dev integration all <TestName>
Example:
/mt-dev integration all TestBootstrap → make build && go test -run TestBootstrap ./go/test/endtoend/...Run with pattern matching:
/mt-dev integration <package-name> <TestPattern>
Examples:
/mt-dev integration queryserving Test.*Transaction.* - All transaction tests/mt-dev integration multipooler TestConn.* - All connection testsSame flags as unit tests, plus:
-timeout=30m - Integration tests often need longer timeouts (default: 10m)-p=1 - Run packages sequentially (useful if tests conflict on resources)-count=N - Run tests N times (useful to detect flakes); -count=1 also forces re-run and bypasses test cache# Run all integration tests
/mt-dev integration all
# Test multipooler with verbose output
/mt-dev integration multipooler -v
# Test specific failure scenario
/mt-dev integration multiorch TestFixReplication
# Check for race conditions in query serving
/mt-dev integration queryserving -race
# Test for flakiness (run 10 times)
/mt-dev integration multipooler TestConnCache -count=10
# Run with extended timeout
/mt-dev integration all -timeout=45m
# Sequential execution to avoid resource conflicts
/mt-dev integration all -p=1
/mt-dev integration all/mt-dev integration multipooler/mt-dev integration multiorch TestFixReplication/mt-dev integration all -race/mt-dev integration queryservingPASS
ok github.com/multigres/multigres/go/services/multipooler 2.456s
--- FAIL: TestConnectionPool (0.15s)
pool_test.go:45: expected 10 connections, got 8
FAIL
FAIL github.com/multigres/multigres/go/services/multipooler 2.456s
# github.com/multigres/multigres/go/services/multipooler
./connection.go:123:45: undefined: somethingMissing
FAIL github.com/multigres/multigres/go/services/multipooler [build failed]
==================
WARNING: DATA RACE
Read at 0x00c0001a2080 by goroutine 7:
...
==================
panic: test timed out after 10m0s
# 1. Run unit tests (fast feedback)
/mt-dev unit all
# 2. If unit tests pass, run integration tests
/mt-dev integration all
# 3. Check for race conditions
/mt-dev integration all -race
# 1. Run the specific test with verbose output
/mt-dev integration multipooler TestConnCache -v
# 2. Check if it's flaky (intermittent failure)
/mt-dev integration multipooler TestConnCache -count=10
# 3. Run with race detector
/mt-dev integration multipooler TestConnCache -race -v
# Unit tests first (fast)
/mt-dev unit ./go/services/multipooler/... -v
# Integration tests second
/mt-dev integration multipooler -v
make build manually to see detailed error-count=10 to reproduce-raceWhen integration tests fail, logs are automatically preserved in a temp directory. Follow this systematic approach to debug failures:
After a test failure, look for this message in the test output:
==== TEST LOGS PRESERVED ====
Logs available at: /tmp/shardsetup_test_XXXXXXXXXX
Set TEST_PRINT_LOGS=1 to print log contents
===========================
The temp directory contains all component logs from the failed test.
Integration test log directories follow this structure:
/tmp/shardsetup_test_XXXXXXXXXX/
├── multigateway.log # Multigateway service logs
├── temp-multiorch/ # Temporary multiorch used during bootstrap
│ └── multiorch.log
├── pooler-1/ # First multipooler instance (pooler-1, pooler-2, etc.)
│ ├── multipooler.log # Multipooler service logs
│ ├── pgctld.log # PostgreSQL control daemon logs
│ └── data/
│ ├── pg_data/
│ │ └── postgresql.log # PostgreSQL server logs
│ ├── pg_sockets/ # Unix sockets for PostgreSQL connections
│ └── pgbackrest/
│ └── logs/ # Backup/restore logs
│ ├── multigres-backup.log
│ ├── multigres-restore.log
│ └── all-server.log
├── pooler-2/ # Second multipooler instance
│ └── (same structure as pooler-1)
├── pooler-3/ # Third multipooler instance
│ └── (same structure as pooler-1)
├── etcd_data/ # etcd data directory
├── backup-repo/ # pgBackRest backup repository
└── certs/ # TLS certificates for pgBackRest
Read the test failure message to identify which component is involved:
Example failure patterns:
pooler-*/data/pgbackrest/logs/Use this decision tree:
What component is the test about?
pooler-*/multipooler.logpooler-*/data/pg_data/postgresql.logmultigateway.logtemp-multiorch/multiorch.logLook for ERROR or FATAL level messages in the relevant logs
Check timestamps - Look at logs around the time of the test failure
Follow the chain - If one component reports an error from another, check that component's logs next
# View all log files in the preserved directory
find /tmp/shardsetup_test_XXXXXXXXXX -name "*.log" -type f
# Search for errors across all logs
grep -r "ERROR\|FATAL" /tmp/shardsetup_test_XXXXXXXXXX/
# View logs for a specific pooler
cat /tmp/shardsetup_test_XXXXXXXXXX/pooler-1/multipooler.log
cat /tmp/shardsetup_test_XXXXXXXXXX/pooler-1/data/pg_data/postgresql.log
# View multigateway logs
cat /tmp/shardsetup_test_XXXXXXXXXX/multigateway.log
# View backup/restore logs
ls /tmp/shardsetup_test_XXXXXXXXXX/pooler-1/data/pgbackrest/logs/
To see full log contents printed directly in test output (useful for CI):
TEST_PRINT_LOGS=1 /mt-dev integration shardsetup TestName
This will print all log files to stdout after the test fails, making them visible in CI logs without needing to download artifacts.
Scenario: TestReplicationWorks fails with "replication not configured"
Find logs: Test output shows /tmp/shardsetup_test_1342939839
Identify components: Replication involves multipooler and PostgreSQL on all nodes
Check pooler logs:
# Check multipooler logs for all poolers