Skip to content

[Enhancement] Inconsistent rowcount in SHOW DATA command across sessions #49106

@dataroaring

Description

@dataroaring

Search before asking

  • I had searched in the issues and found no similar issues.

Description

Version: 3.0.3
Issue:
When executing the SHOW DATA command in different sessions, the rowcount value occasionally returns 0 inconsistently. Once a session initially succeeds or fails to retrieve the correct rowcount, subsequent executions in the same session persistently return the same result (either valid or 0). This indicates potential caching or session state propagation issues in FE nodes.

Key Observations:

  1. Behavior is inconsistent across sessions (some sessions return valid rowcount, others return 0).
  2. Session-level persistence of the result (no updates after initial success/failure).
  3. Suspected link to FE master-slave synchronization or request forwarding logic.

Related Context

  • Potential root causes:
    • Metrics not properly synchronized between FE nodes.
    • SHOW DATA requests may not be forwarded to the master FE in some cases.
  • Suggested fix: Override getRedirectStatus in ShowDataStmt to enforce forwarding to the master FE.

Steps to Reproduce

  1. Connect to a non-master FE node.
  2. Open two separate sessions (e.g., via different clients).
  3. Execute SHOW DATA; in both sessions.
  4. Observe inconsistent rowcount values (0 vs. valid count) across sessions.
  5. Re-execute SHOW DATA in the same sessions; results remain unchanged.

Expected Behavior

  • Consistent rowcount across all sessions.
  • Fresh metrics should be fetched on each execution (no session-level caching).

Environment

  • Cluster setup: 存算分离架构 (compute-storage separation).
  • FE nodes: Master-slave deployment.

Proposed Action

  1. Verify if direct MySQL connection to the master FE resolves the issue.
  2. Review ShowDataStmt request routing logic (getRedirectStatus override).
  3. Ensure metrics are actively refreshed per request or synchronized across FEs.

Solution

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions