mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-15 09:22:55 +00:00
Fix flushing prefetch requests in page_server_request
This commit is contained in:
committed by
John Spray
parent
2c21c74ff4
commit
21c3c55e6b
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user