Files
Nikita Fomichev a78bcc708e utils: add auto-bisect script for ClickHouse regression bisection
Adds `utils/auto-bisect/` — a shell-based bisection framework that
downloads pre-built CI binaries and runs a user-supplied test script
to find the first bad commit.

Key features:
- Downloads public CI binaries from S3 by default; private CloudFront
  builds with `--private` (credentials via `CH_CI_BASIC_AUTH` env var,
  `CH_CI_USER`/`CH_CI_PASSWORD`, or `/etc/netrc`)
- Three environment modes: `single` (one server), `replicateddb` (two
  nodes + Keeper, Replicated database), `sharedcatalog` (two nodes +
  Keeper, SharedCatalog)
- Uses `git bisect --no-checkout` by default so the work tree is not
  modified during bisection
- Walker mode (`--walker`) for linear commit-by-commit testing
- Example test scripts in `tests/`

Tested locally: `--env nothing`, `--env single`, and `--env replicateddb`
all verified working.
2026-03-28 10:39:03 +01:00

48 lines
793 B
Bash
Executable File

#!/bin/bash
set -e
CH_PATH=${CH_PATH:=clickhouse}
(
$CH_PATH client -mn -q "
select version();
drop table if exists tbl;
create table tbl (
timestamp DateTime,
projection proj (select * order by timestamp))
engine MergeTree order by ()
TTL timestamp + INTERVAL 1 DAY
settings min_bytes_for_wide_part = 1, index_granularity = 1;
insert into tbl
select today() - 100
union all
select today() + 50;
optimize table tbl final;
"
result=$($CH_PATH client -mn -q "
SELECT groupBitXor(cityHash64(*))
FROM (
select rows from (
select rows from system.parts where table = 'tbl' and active
union all
select rows from system.projection_parts where table = 'tbl' and active
)
order by rows
);
"
)
echo $result
if [ "$result" = "0" ]; then
exit 1
else
exit 0
fi
)