Skip to content

feat: add support for configuring tcp_user_timeout on replicas#7036

Merged
gbartolini merged 15 commits intocloudnative-pg:mainfrom
leonardoce:custom-primary-conninfo
Mar 17, 2025
Merged

feat: add support for configuring tcp_user_timeout on replicas#7036
gbartolini merged 15 commits intocloudnative-pg:mainfrom
leonardoce:custom-primary-conninfo

Conversation

@leonardoce
Copy link
Contributor

@leonardoce leonardoce commented Feb 28, 2025

Introduces the STANDBY_TCP_USER_TIMEOUT operator configuration setting, which, if specified, sets the tcp_user_timeout parameter on all standby instances managed by the operator. The default value is 0, which means the system’s default is used.

The tcp_user_timeout parameter controls how long transmitted data can remain unacknowledged before the TCP connection is forcibly closed. This allows fine-tuning of standby responsiveness to network disruptions.

Closes #7119

@leonardoce leonardoce requested review from a team and jsilvela as code owners February 28, 2025 16:26
@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.22 release-1.24 release-1.25 labels Feb 28, 2025
@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

@leonardoce leonardoce force-pushed the custom-primary-conninfo branch from cb89cde to 3a32a1a Compare February 28, 2025 16:26
@leonardoce leonardoce added do not backport This PR must not be backported - it will be in the next minor release and removed backport-requested ◀️ This pull request should be backported to all supported releases release-1.22 release-1.24 release-1.25 labels Feb 28, 2025
@mnencia mnencia force-pushed the custom-primary-conninfo branch from 3a32a1a to ab6f33a Compare March 2, 2025 13:16
@gbartolini gbartolini force-pushed the custom-primary-conninfo branch from fbdf3d8 to ac3940f Compare March 3, 2025 16:53
@gbartolini gbartolini changed the title feat: allow customizing primary_conninfo feat: allow customizing primary_conninfo Mar 3, 2025
@fcanovai fcanovai self-requested a review March 4, 2025 13:19
@fcanovai fcanovai self-assigned this Mar 4, 2025
@fcanovai fcanovai force-pushed the custom-primary-conninfo branch from d90ee4c to 46ead76 Compare March 4, 2025 13:22
@leonardoce leonardoce force-pushed the custom-primary-conninfo branch from ad01e2c to a1af47a Compare March 4, 2025 17:04
@fcanovai fcanovai force-pushed the custom-primary-conninfo branch from a1af47a to d2be90b Compare March 11, 2025 13:36
@fcanovai fcanovai force-pushed the custom-primary-conninfo branch from d2be90b to b1c9888 Compare March 11, 2025 13:37
@fcanovai fcanovai force-pushed the custom-primary-conninfo branch from b1c9888 to 99a96f8 Compare March 11, 2025 17:26
@mnencia mnencia force-pushed the custom-primary-conninfo branch from 99a96f8 to 1f878c8 Compare March 12, 2025 13:04
@fcanovai fcanovai force-pushed the custom-primary-conninfo branch from 1f878c8 to bd13900 Compare March 12, 2025 13:20
@mnencia
Copy link
Member

mnencia commented Mar 12, 2025

/test tl=4 d=main

@github-actions
Copy link
Contributor

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

@mnencia mnencia changed the title feat: allow customizing primary_conninfo feat: configure tcp_user_timeout setting for replicas Mar 13, 2025
leonardoce and others added 13 commits March 17, 2025 11:28
This patch allows the user to customize the `primary_conninfo` GUC of HA
replicas. The validating webhook allows the user to configure only the
connection parameters that are not automatically set by the operator.

Feat: cloudnative-pg#7035

Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
While discussing this patch, we realized that these settings are a
property of the execution environment and not of the individual
cluster.

Because of that, this experiment rework as a new operator
configuration parameter.

Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Update the e2e suite to always use iptables. This is usually the default
of a k8s cluster, and puts the cluster at risk of not receiving
connections due to them ending up in a tcp_syn_retries timeout. This
allows us to test `STANDBY_TCP_SYN_RETRIES` behaviour, and verify fringe
behaviours in the cluster.

Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Update the webtest version to 1.7.0

Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Preserve the older configmap when running tests on it, and reinstall it
afterwards.

Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Using Expect within an Eventually doesn't retry the Eventually function,
but fails immediately. Remove bare Expects and use g.Expect, or return
an error to the eventually instead.

Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
@mnencia mnencia force-pushed the custom-primary-conninfo branch from f09f83d to 8758c22 Compare March 17, 2025 10:28
@mnencia
Copy link
Member

mnencia commented Mar 17, 2025

/test tl=4 d=main

@github-actions
Copy link
Contributor

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

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Mar 17, 2025
@gbartolini gbartolini changed the title feat: configure tcp_user_timeout setting for replicas feat: configure tcp_user_timeout setting for replicas Mar 17, 2025
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
@gbartolini gbartolini changed the title feat: configure tcp_user_timeout setting for replicas feat: add support for configuring tcp_user_timeout on replicas Mar 17, 2025
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
@gbartolini gbartolini merged commit 10a87e1 into cloudnative-pg:main Mar 17, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not backport This PR must not be backported - it will be in the next minor release ok to merge 👌 This PR can be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Configure tcp_user_timeout setting for replicas

5 participants