Fix flushing prefetch requests in page_server_request

This commit is contained in:
Konstantin Knizhnik
2023-12-01 16:37:30 +02:00
committed by John Spray
parent 2c21c74ff4
commit 21c3c55e6b
2 changed files with 7 additions and 4 deletions

View File

@@ -930,7 +930,6 @@ page_server_request(void const *req)
do {
while (!page_server->send(shard_no, (NeonRequest *) req) || !page_server->flush(shard_no));
MyPState->ring_flush = MyPState->ring_unused;
consume_prefetch_responses();
resp = page_server->receive(shard_no);
} while (resp == NULL);

View File

@@ -2,6 +2,7 @@ from fixtures.neon_fixtures import NeonEnvBuilder
import pytest
@pytest.mark.parametrize("shard_count", [2])
@pytest.mark.timeout(1000)
def test_sharding(neon_env_builder: NeonEnvBuilder, shard_count: int):
neon_env_builder.enable_generations = True
neon_env_builder.initial_shard_count = shard_count
@@ -14,6 +15,9 @@ def test_sharding(neon_env_builder: NeonEnvBuilder, shard_count: int):
pageserver.allowed_errors.append(".*Dropping stale deletions for tenant.*")
endpoint = env.endpoints.create_start("main", pageserver_ids=[p.id for p in env.pageservers])
endpoint.safe_psql("create table t(t bigint, payload text default repeat('?',200))")
endpoint.safe_psql("insert into t values(generate_series(1,10000000))")
assert endpoint.safe_psql("select count(*) from t")[0][0] == 10000000
with endpoint.cursor() as cur:
cur.execute("SET statement_timeout=0") # disable statement timeout
cur.execute("create table t(t bigint, payload text default repeat('?',200))")
cur.execute("insert into t values(generate_series(1,10000000))")
cur.execute("select count(*) from t")
assert cur.fetchone()[0] == 10000000