Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bytebase/bytebase
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: bytebase/bytebase
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: p0ny/sample-instance-loadtest
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 10 commits
  • 14 files changed
  • 1 contributor

Commits on Aug 13, 2026

  1. feat(loadtest): add sample-instance capacity load-test harness

    Add a DSN-driven harness that provisions isolated sample databases and
    roles, seeds the Bytebase sample HR schema, replays Bytebase-like sync,
    DDL, and interactive workloads, records measurements, and removes
    everything it created. Phase 1 runs the matrix against local Postgres via
    testcontainers; a CLI entrypoint is included for the Cloud SQL leg.
    
    Includes the agreed workload assumptions and pass/fail thresholds in the
    README.
    RainbowDashy committed Aug 13, 2026
    Configuration menu
    Copy the full SHA
    e65c523 View commit details
    Browse the repository at this point in the history
  2. fix(loadtest): make sample-instance harness Cloud SQL compatible

    Cloud SQL's postgres user is a restricted superuser that cannot SET ROLE,
    transfer database ownership, or drop databases it does not own. Provisioning
    with CREATE DATABASE ... OWNER therefore fails. Change the model to: the
    admin owns each database and the workspace role is a least-privilege CONNECT
    + SELECT role (provision/seed/sync/DDL as admin, interactive queries as the
    role).
    
    Also harden the harness for re-runs and flaky networks: connect_timeout on
    all DSNs, a best-effort pre-run cleanup of the name prefix, an empty-tenants
    guard in the orchestrator, a -verbose flag, and PGPASSWORD env fallback so
    the password is not exposed in argv.
    RainbowDashy committed Aug 13, 2026
    Configuration menu
    Copy the full SHA
    3297cde View commit details
    Browse the repository at this point in the history
  3. fix(loadtest): redact credentials and seed SQL from the JSON report

    The report marshaled Config and Tenant verbatim, leaking the admin password,
    per-tenant passwords, and the 570 KB seed SQL into the report and serial
    console. Exclude AdminPassword, SeedSQL, and Tenant.Password from JSON.
    RainbowDashy committed Aug 13, 2026
    Configuration menu
    Copy the full SHA
    0f85084 View commit details
    Browse the repository at this point in the history
  4. feat(loadtest): add full-overlap worst-case workload

    Run sync, interactive, and DDL simultaneously, each with one worker or
    session per database, instead of the capped/sequential phases. This models
    the worst case where every workspace is syncing, querying, and applying DDL
    at the same time, exposing the instance's CPU/RAM ceiling rather than the
    connection limit.
    RainbowDashy committed Aug 13, 2026
    Configuration menu
    Copy the full SHA
    1940aba View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7c8dc37 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    bd52552 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2026

  1. feat(loadtest): model per-workspace sync/DDL with per-database role

    Sync and change-ticket DDL now connect as each workspace's per-database
    role and are capped at a modest realistic overlap (default 10 and 5
    concurrent) instead of an N-wide pool that treated sync as one
    coordination point syncing every database as admin. Interactive
    concurrency is held fixed (10 steady / 50 burst) while database count
    varies. Seed transfers ownership of the public schema and its objects to
    the tenant role so role-scoped DDL works; serial-owned sequences follow
    their table. Also rename loadSampleData to loadSampleDataFromFS to
    silence the revive confusing-naming lint.
    RainbowDashy committed Aug 14, 2026
    Configuration menu
    Copy the full SHA
    543997b View commit details
    Browse the repository at this point in the history
  2. fix(loadtest): seed as the workspace role and terminate its backends …

    …before drop
    
    Cloud SQL's postgres user is not a superuser (rolsuper=false) and cannot
    SET ROLE or transfer ownership of objects it creates, so a role can only
    own what it creates itself. Seed each tenant database as the tenant role
    (after the control plane grants CREATE ON DATABASE and ON SCHEMA public)
    instead of seeding as admin and trying to transfer ownership, which fails
    with 'must be able to SET ROLE'.
    
    Cleanup now connects as the tenant role to terminate its lingering
    backends before DROP DATABASE WITH (FORCE), modeling the 7-day expiry:
    postgres cannot terminate another role's processes, so FORCE alone races
    with session teardown at scale and leaves orphaned databases and roles.
    RainbowDashy committed Aug 14, 2026
    Configuration menu
    Copy the full SHA
    9306860 View commit details
    Browse the repository at this point in the history
  3. fix(loadtest): drain lingering backends before dropping tenant databases

    Backend termination is asynchronous: a backend can linger for a moment
    after its client socket closes, and dropping the database in that window
    fails because Cloud SQL's postgres user cannot terminate another role's
    processes. After terminating the role's backends, poll pg_stat_activity
    until the database has no backends, then drop with a bounded retry. The
    retry also covers a backend that appears between the drain check and the
    drop. Validated on Cloud SQL: the 70/500/1000 matrix completes with zero
    cleanup failures and no orphaned databases or roles.
    RainbowDashy committed Aug 14, 2026
    Configuration menu
    Copy the full SHA
    0f67f85 View commit details
    Browse the repository at this point in the history
  4. fix(loadtest): sync one worker per database, all concurrent

    The per-workspace sync model spawns one worker per database and runs all
    workers concurrently, each syncing its own database as its own
    per-database role (the worst case where every workspace syncs at once).
    The previous 10-concurrent cap was a misreading of the handoff and
    understated sync load. Drop the now-dead SyncConcurrency knob; DDL (5)
    and interactive (10/50) concurrency are unchanged.
    RainbowDashy committed Aug 14, 2026
    Configuration menu
    Copy the full SHA
    5fa6b51 View commit details
    Browse the repository at this point in the history
Loading