Files
greptimedb/tests-integration/fixtures/docker-compose.yml
T
Lei, HUANG e9dd79d1d2 fix(mito2): compare primary key ranges across schema versions (#9205)
* fix(mito2): compare primary key ranges across schema versions

Bind FileHandle ranges to the pinned region schema and append cached constant defaults to historical Dense keys. Preserve raw SST statistics, reject inexact bounds, and avoid invalidating views for unrelated metadata changes.

Cover schema evolution, default changes, and tombstone retention through real compaction and reopen regressions.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* refactor(mito2): report invalid primary key ranges

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* refactor(mito2): scope primary key ranges to comparisons

Keep raw PK bounds only in FileHandleInner and move schema-aware mapping and caching into task-local comparison contexts.

Use explicit contexts for compaction overlap checks, window aggregation, and series scans. Preserve pinned-schema isolation, late statistics, and shared file lifecycle state without rebinding every handle.

Cover cache isolation across region owners and adapt range fixtures to real Dense encodings. All 1530 mito2 tests and Clippy for all targets with the testing feature pass.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* refactor(mito2): cache aligned primary key ranges per file

Replace task-local range maps with a single-slot cache in FileHandleInner, keyed by the target schema version. Preserve raw bounds for realignment across snapshots and default changes.

Share schema mappers across comparison paths and use copy-on-write SST lists for metadata updates. Simplify range mapping to accept encoded bounds and assert the same-table contract at the file accessor.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* docs(mito2): clarify primary key mapper schema snapshot

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* test(mito2): align primary key range fixtures with table contract

Remove obsolete cross-table fallback expectations after region validation became a caller contract. Give compaction fixtures matching table identities, including the active-window L1 scenario.

Clarify the mapper precondition and format the simplified alignment call. All 1530 mito2 tests and Clippy for all targets with the testing feature pass.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* test(mito2): enable filesystem GC in release unit tests

Let unit tests use the filesystem-backed object-store GC path regardless of optimization profile. Keep the production release GC selection unchanged.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* perf(mito-codec): skip release value decoding in PK prefix counts

Validate field values only in debug builds and unit tests while keeping boundary, truncation, and trailing-byte checks in every build.

Cover the linked library in debug and release integration tests, and verify that release unit tests still perform value validation.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* test(mito-codec): remove redundant prefix integration tests

Retain the codec unit tests and cross-schema compaction regressions while dropping the standalone build-profile test file and its release-only invalid-value expectation.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* ci: wait for MySQL to accept authenticated TCP queries

Add a healthcheck using the configured test account and database. Docker Compose --wait previously only observed container startup because the fixture image had no healthcheck, allowing metasrv to connect before MySQL initialization completed.

Verify readiness with SELECT 1 over TCP rather than the initialization socket.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

---------

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
2026-09-20 14:30:12 +00:00

154 lines
4.5 KiB
YAML

services:
zookeeper:
image: greptime/zookeeper:3.7
ports:
- '2181:2181'
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
kafka:
image: greptime/kafka:3.9.0-debian-12-r1
container_name: kafka
ports:
- 9092:9092
- 9093:9093
environment:
KAFKA_CFG_NODE_ID: "1"
KAFKA_CFG_PROCESS_ROLES: broker,controller
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 1@127.0.0.1:2181
# Listeners
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://127.0.0.1:9092,SECURE://localhost:9093
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,SECURE:SASL_PLAINTEXT
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:2181,SECURE://:9093
ALLOW_PLAINTEXT_LISTENER: "yes"
KAFKA_BROKER_ID: "1"
KAFKA_CLIENT_USERS: "user_kafka"
KAFKA_CLIENT_PASSWORDS: "secret"
KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: false
depends_on:
zookeeper:
condition: service_started
etcd:
image: greptime/etcd:3.6.1-debian-12-r3
ports:
- "2379:2379"
- "2380:2380"
environment:
ALLOW_NONE_AUTHENTICATION: "yes"
ETCD_NAME: etcd
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379
ETCD_ADVERTISE_CLIENT_URLS: http://etcd:2379
ETCD_MAX_REQUEST_BYTES: 10485760
etcd-tls:
image: greptime/etcd:3.6.1-debian-12-r3
ports:
- "2378:2378"
- "2381:2381"
environment:
ALLOW_NONE_AUTHENTICATION: "yes"
ETCD_NAME: etcd-tls
ETCD_LISTEN_CLIENT_URLS: https://0.0.0.0:2378
ETCD_ADVERTISE_CLIENT_URLS: https://etcd-tls:2378
ETCD_LISTEN_PEER_URLS: https://0.0.0.0:2381
ETCD_INITIAL_ADVERTISE_PEER_URLS: https://etcd-tls:2381
ETCD_INITIAL_CLUSTER: etcd-tls=https://etcd-tls:2381
ETCD_INITIAL_CLUSTER_TOKEN: etcd-tls-cluster
ETCD_INITIAL_CLUSTER_STATE: new
ETCD_CERT_FILE: /certs/server.crt
ETCD_KEY_FILE: /certs/server-key.pem
ETCD_TRUSTED_CA_FILE: /certs/ca.crt
ETCD_PEER_CERT_FILE: /certs/server.crt
ETCD_PEER_KEY_FILE: /certs/server-key.pem
ETCD_PEER_TRUSTED_CA_FILE: /certs/ca.crt
ETCD_CLIENT_CERT_AUTH: "true"
ETCD_PEER_CLIENT_CERT_AUTH: "true"
ETCD_MAX_REQUEST_BYTES: 10485760
volumes:
- ./etcd-tls-certs:/certs:ro
minio:
image: greptime/minio:2024
ports:
- '9000:9000'
- '9001:9001'
environment:
- MINIO_ROOT_USER=superpower_ci_user
- MINIO_ROOT_PASSWORD=superpower_password
- MINIO_DEFAULT_BUCKETS=greptime
- BITNAMI_DEBUG=true
volumes:
- 'minio_data:/bitnami/minio/data'
postgres:
image: docker.io/postgres:14-alpine
ports:
- 5432:5432
volumes:
- ~/apps/postgres:/var/lib/postgresql/data
- ./certs:/tmp/certs:ro
- ./postgres/tls/pg_hba.conf:/var/lib/postgresql/pg_hba.conf
environment:
- POSTGRES_USER=greptimedb
- POSTGRES_DB=postgres
- POSTGRES_PASSWORD=admin
# Hack: Ensures certs are owned by database user with 600 permissions.
command: >
bash -c "
mkdir -p /certs &&
cp /tmp/certs/* /certs &&
chown -R postgres:postgres /certs &&
chmod 600 /certs/*.key &&
chmod 644 /certs/*.crt &&
exec docker-entrypoint.sh postgres
-c hba_file=/var/lib/postgresql/pg_hba.conf
-c ssl=on
-c ssl_cert_file=/certs/server.crt
-c ssl_key_file=/certs/server.key
-c ssl_ca_file=/certs/root.crt"
postgres15:
image: docker.io/postgres:15-alpine
ports:
- 5433:5432
volumes:
- ~/apps/postgres15:/var/lib/postgresql/data
- ./postgres/init.sql:/docker-entrypoint-initdb.d/01-init.sql:ro
environment:
- POSTGRES_USER=greptimedb
- POSTGRES_DB=postgres
- POSTGRES_PASSWORD=admin
mysql:
image: greptime/mysql:5.7
ports:
- 3306:3306
volumes:
- ./certs:/certs:ro
- ./mysql/my.cnf:/opt/bitnami/mysql/conf/my_custom.cnf:ro
environment:
- MYSQL_DATABASE=mysql
- MYSQL_USER=greptimedb
- MYSQL_PASSWORD=admin
- MYSQL_ROOT_PASSWORD=admin
# Wait for authenticated TCP queries, not just the container or initialization socket.
healthcheck:
test:
- CMD-SHELL
- >-
MYSQL_PWD="$${MYSQL_PASSWORD}" mysql
--protocol=TCP --host=127.0.0.1
--user="$${MYSQL_USER}" --database="$${MYSQL_DATABASE}"
--execute="SELECT 1"
interval: 2s
timeout: 5s
retries: 30
start_period: 10s
volumes:
minio_data:
driver: local