mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-03 11:32:56 +00:00
\## Problem See https://github.com/neondatabase/neon/issues/12119#issuecomment-2942586090 Page server restarts with interval 1 seconds increases time of vacuum especially off prefetch is enabled and so cause test failure because of statement timeout expiration. ## Summary of changes Increase statement timeout to 360 seconds. --------- Co-authored-by: Konstantin Knizhnik <knizhnik@neon.tech> Co-authored-by: Alexander Lakhin <alexander.lakhin@neon.tech>
45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
# This test spawns pgbench in a thread in the background and concurrently restarts pageserver,
|
|
# checking how client is able to transparently restore connection to pageserver
|
|
#
|
|
|
|
from __future__ import annotations
|
|
|
|
import threading
|
|
import time
|
|
from typing import TYPE_CHECKING
|
|
|
|
from fixtures.log_helper import log
|
|
|
|
if TYPE_CHECKING:
|
|
from fixtures.neon_fixtures import NeonEnv, PgBin
|
|
|
|
|
|
# Test restarting page server, while safekeeper and compute node keep
|
|
# running.
|
|
def test_pageserver_restarts_under_workload(neon_simple_env: NeonEnv, pg_bin: PgBin):
|
|
env = neon_simple_env
|
|
env.create_branch("test_pageserver_restarts")
|
|
endpoint = env.endpoints.create_start("test_pageserver_restarts")
|
|
n_restarts = 10
|
|
scale = 10
|
|
|
|
def run_pgbench(connstr: str):
|
|
log.info(f"Start a pgbench workload on pg {connstr}")
|
|
pg_bin.run_capture(["pgbench", "-i", "-I", "dtGvp", f"-s{scale}", connstr])
|
|
pg_bin.run_capture(["pgbench", f"-T{n_restarts}", connstr])
|
|
|
|
thread = threading.Thread(
|
|
target=run_pgbench,
|
|
args=(endpoint.connstr(options="-cstatement_timeout=360s"),),
|
|
daemon=True,
|
|
)
|
|
thread.start()
|
|
|
|
for _ in range(n_restarts):
|
|
# Stop the pageserver gracefully and restart it.
|
|
time.sleep(1)
|
|
env.pageserver.stop()
|
|
env.pageserver.start()
|
|
|
|
thread.join()
|