Skip to content

[Bug]: logservice replica health remains unhealthy after clean 2CN startup #27184

Closed

Description

@XuPeng-SH

Branch Name

main

Commit ID

7a01e120c610f0ac4d66c2bce22e3cd624ceb751

Other Environment Information

  • Host: [email protected], Debian Linux, linux/amd64
  • Binary: rebuilt from the commit above with Go 1.26.4, GOAMD64=v3, GOEXPERIMENT=simd
  • Topology: standard etc/launch-multi-cn/launch.toml (1 LogService + 1 TN + 2 CN)
  • Original ports: CN SQL 16001 and 16002, LogService 32001
  • Reproduced again with a clean temporary data directory and isolated ports 17601/17602 and LogService 34001
  • No partitioned tables or partition features are involved

Actual Behavior

After a clean 2CN launch reaches wait.tn.ready.ready.completed and both CN SQL endpoints accept queries, LogService emits this error once per heartbeat indefinitely:

ERROR logservice/store.go:654 error: internal error: shard 2 not started on store 7c4dccb4-4d3c-41f8-b482-5251dc7a41bf
ERROR log-service ... failed to check health ...

The same error reproduces with the isolated clean data directory, so it is not stale catalog or old mo-data state. The public SQL path remains usable, but checkReplicaHealth handles this error by setting mo_logservice_replica_health to 0, which reports the active replica as unhealthy after successful cluster readiness.

The standard 2CN black-box harness passed DDL/DML, cross-CN reads and writes, joins, aggregates, transactions, prepared statements, set operators, concurrent inserts, and connection churn; the health error remains independently observable in the service log.

Expected Behavior

Once TN is ready and the active LogService can serve the 2CN cluster, the TN replica health check should resolve successfully and mo_logservice_replica_health should stay healthy (1). If the check is intentionally not applicable in a single-LogStore local deployment, it should not emit a continuous error or report a false unhealthy gauge.

Steps to Reproduce

  1. On a clean checkout of the commit above, build mo-service.

  2. From /home/xupeng/matrixone, launch:

    ./mo-service -launch etc/launch-multi-cn/launch.toml
  3. Wait until ports 16001 and 16002 are listening and the log contains wait.tn.ready.ready.completed.

  4. Verify both public endpoints:

    mysql --protocol=tcp --skip-ssl -h127.0.0.1 -P16001 -uroot -p111 -e 'select 1+1'
    mysql --protocol=tcp --skip-ssl -h127.0.0.1 -P16002 -uroot -p111 -e 'select 1+1'
  5. Observe /tmp/matrixone-main-2cn.log for at least 30 seconds:

    grep 'shard 2 not started on store' /tmp/matrixone-main-2cn.log
  6. Repeat with a clean temporary data directory and isolated ports; the same health error persists after readiness.

Additional information

Relevant code path:

  • pkg/logservice/service_commands.go: checkReplicaHealth obtains the TN shard ID and calls store.checkHealth.
  • pkg/logservice/store.go: checkHealth returns shard %d not started on store %s when the active store UUID is absent from cs.LogState.Stores.
  • pkg/logservice/service_commands.go: the error path sets v2.LogServiceReplicaHealthGauge to 0.

This appears distinct from the previously reported failover/Operator issues #26058 and #26059 because it reproduces on a clean, single-LogStore local 2CN launch without member replacement or network chaos.

Activity

  1. added
    kind/bug
    on Aug 14, 2026
  2. XuPeng-SH commented on Aug 19, 2026

    @XuPeng-SH
    ContributorAuthor

    Reproduced again on a later current-main commit, with clean project data.

    Branch Name: main
    Commit ID: 6f42b19

    Environment:

    • Host 10.222.1.55
    • Cold isolated Docker Compose startup: 1 LogService, 1 TN, 2 CN, MinIO, proxy
    • All services became ready; 65 fresh database/table/insert sequences completed and all pressure-created rows remained visible

    Actual Behavior:

    • LogService emitted 599 ERROR records:
      failed to check health: internal error: shard 2 not started on store ...
    • The first was at 22:11:18 and the same error was still emitted at 22:28:06, long after SQL readiness.
    • All MO containers remained running with zero restart and zero OOM.

    Expected Behavior:
    After cluster readiness, the active replica health check should resolve successfully. If the check is not applicable to this single-LogStore compose topology, it should not continuously report an ERROR and unhealthy gauge.

    Steps to Reproduce:

    1. Cold-start etc/launch-tae-compose with the launch-multi-cn profile and clean data.
    2. Wait for proxy SQL readiness and execute normal DDL/DML.
    3. Observe LogService logs for at least several minutes.

    Consequence:

    • Persistent false unhealthy telemetry and roughly one ERROR every check interval.
    • 599 ERROR records in about 17 minutes in this run.
    • SQL remained available, so this run proves observability corruption/noise rather than data loss.
  3. XuPeng-SH commented on Aug 19, 2026

    @XuPeng-SH
    ContributorAuthor

    Correction to the reproduction comment above: the exact total was 60 fresh database/table/insert sequences, not 65 (10 baseline + 40 across four pressure rounds + 10 post-pressure controls). All 60 completed and all pressure-created rows checked were visible.

  4. added
    severity/s0
    and removed on Aug 20, 2026
  5. LeftHandCold commented on Sep 1, 2026

    @LeftHandCold
    Collaborator

    fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions