Skip to content

Fix the issue of duplicate counting of num_executed in gp_toolkit.gp_resgroup_status#1646

Merged
tuhaihe merged 1 commit intoapache:mainfrom
fairyfar:resgroup
Apr 1, 2026
Merged

Fix the issue of duplicate counting of num_executed in gp_toolkit.gp_resgroup_status#1646
tuhaihe merged 1 commit intoapache:mainfrom
fairyfar:resgroup

Conversation

@fairyfar
Copy link
Copy Markdown
Contributor

What does this PR do?

Fix the issue of duplicate counting of num_executed in gp_toolkit.gp_resgroup_status
This is a defect of the original GPDB.
When enabling resource group management and the transaction switches from "Assigned" to "Bypass" state, the "num_executed" counter is repeatedly counted.

Reproducing test cases:

  1. Enable resource group: set gp_resource_manager to "group".

  2. Log in with the default superuser.

  3. Execute gp_toolkit.gp_resgroup_status twice.

SELECT groupname, num_executed FROM gp_toolkit.gp_resgroup_status WHERE groupname='admin_group';
 groupname   | num_executed 
-------------+--------------
 admin_group | 31           
(1 row)
SELECT groupname, num_executed FROM gp_toolkit.gp_resgroup_status WHERE groupname='admin_group';
 groupname   | num_executed 
-------------+--------------
 admin_group | 33           
(1 row)

The test case has been added to:

‎src/test/isolation2/sql/resgroup/resgroup_bypass.sql

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


Copy link
Copy Markdown
Contributor

@my-ship-it my-ship-it left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Nice catch on this inherited GPDB defect. 👍

@tuhaihe tuhaihe requested a review from yjhjstz March 31, 2026 03:41
Copy link
Copy Markdown
Contributor

@leborchuk leborchuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…resgroup_status

This is a defect of the original GPDB.
When enabling resource group management and the transaction switches from "Assign" to "Bypass" state, the "num_executed" counter is repeatedly counted.
@tuhaihe tuhaihe merged commit cb61a95 into apache:main Apr 1, 2026
40 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants