Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enhance the plugin status command #3101

Merged
merged 7 commits into from
Oct 24, 2023

Conversation

YanniHu1996
Copy link
Contributor

@YanniHu1996 YanniHu1996 commented Oct 17, 2023

closes: #3011

While working on this issue, I found that we have an opportunity to reduce the response time of status API by the way used in this PR

// StatusOption is as a function to select which information to include in the status
type StatusOption func(*StatusSelection)
// StatusSelection is used to select which information to include in the status
type StatusSelection struct {
// BasebackupInfo indicates whether to include basebackup information in the status
BasebackupInfo bool
}

Opened a new issue #3121 for tracing it

@github-actions github-actions bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.19 release-1.20 release-1.21 labels Oct 17, 2023
@github-actions
Copy link
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@mnencia
Copy link
Member

mnencia commented Oct 17, 2023

@YanniHu1996 to fix the linter issues you should run golangci-lint run --fix

@github-actions
Copy link
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@YanniHu1996 YanniHu1996 reopened this Oct 19, 2023
@github-actions
Copy link
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@YanniHu1996 YanniHu1996 changed the title fix: remove misleading rows in 'Streaming Replication status' fix: enhance the plugin status command Oct 19, 2023
@YanniHu1996 YanniHu1996 marked this pull request as ready for review October 19, 2023 12:26
@armru armru changed the title fix: enhance the plugin status command feat: enhance the plugin status command Oct 23, 2023
WHERE application_name LIKE $1 AND usename = $2`,
fmt.Sprintf("%s-%%", instance.ClusterName),
WHERE application_name ~ $1 AND usename = $2`,
fmt.Sprintf("%s-[0-9]+$", instance.ClusterName),
Copy link
Member

Choose a reason for hiding this comment

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

Personally I don't know if this changes should be in this patch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The change to this SQL is to filter out rows that are not represented as replication to standby instances, such as a wal sender with the application name <cluster-name-1-join> used by basebackup should not appear in the section Streaming Replication status for status command

@leonardoce leonardoce force-pushed the dev/cnp-4240 branch 2 times, most recently from 616185b to f7b225e Compare October 23, 2023 18:45
@leonardoce
Copy link
Contributor

/test limit=local

@github-actions
Copy link
Contributor

@leonardoce, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/6617646214

YanniHu1996 and others added 7 commits October 24, 2023 08:54
Signed-off-by: YanniHu1996 <yantian.hu@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
The reassig didn't produce any effects

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Tao Li <tao.li@enterprisedb.com>
@leonardoce
Copy link
Contributor

/ok-to-merge

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Oct 24, 2023
@leonardoce
Copy link
Contributor

We've problems with the PRs opened from repositories other than cloudnative-pg/cloudnative-pg. The build containers step is failing. See #3154

@leonardoce leonardoce merged commit 2c29519 into cloudnative-pg:main Oct 24, 2023
24 of 26 checks passed
@leonardoce leonardoce deleted the dev/cnp-4240 branch October 24, 2023 09:28
cnpg-bot pushed a commit that referenced this pull request Oct 24, 2023
`kubectl cnpg status` will now show information about the progress
of backups taken with `pg_basebackup`, allowing monitoring the
replica cloning process.

Closes: #3011

Signed-off-by: YanniHu1996 <yantian.hu@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Tao Li <tao.li@enterprisedb.com>
Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Co-authored-by: Tao Li <tao.li@enterprisedb.com>
(cherry picked from commit 2c29519)
cnpg-bot pushed a commit that referenced this pull request Oct 24, 2023
`kubectl cnpg status` will now show information about the progress
of backups taken with `pg_basebackup`, allowing monitoring the
replica cloning process.

Closes: #3011

Signed-off-by: YanniHu1996 <yantian.hu@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Tao Li <tao.li@enterprisedb.com>
Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Co-authored-by: Tao Li <tao.li@enterprisedb.com>
(cherry picked from commit 2c29519)
cnpg-bot pushed a commit that referenced this pull request Oct 24, 2023
`kubectl cnpg status` will now show information about the progress
of backups taken with `pg_basebackup`, allowing monitoring the
replica cloning process.

Closes: #3011

Signed-off-by: YanniHu1996 <yantian.hu@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Tao Li <tao.li@enterprisedb.com>
Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Co-authored-by: Tao Li <tao.li@enterprisedb.com>
(cherry picked from commit 2c29519)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-requested ◀️ This pull request should be backported to all supported releases ok to merge 👌 This PR can be merged release-1.19 release-1.20 release-1.21
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Properly manage pg_basebackup in cpng status
6 participants