Compare commits

..

1 Commits

Author SHA1 Message Date
Konstantin Knizhnik
7a09dd0ef3 Use buffer tag to avoid hash conflicts in last written LSN cache 2022-07-14 23:54:18 +03:00
8 changed files with 12 additions and 33 deletions

View File

@@ -11,9 +11,8 @@ defaults:
shell: bash -ex {0}
concurrency:
# Allow only one workflow per any non-`main` branch.
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.sha || 'anysha' }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
RUST_BACKTRACE: 1

View File

@@ -11,9 +11,8 @@ defaults:
shell: bash -ex {0}
concurrency:
# Allow only one workflow per any non-`main` branch.
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.sha || 'anysha' }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
RUST_BACKTRACE: 1

View File

@@ -13,9 +13,8 @@ on:
workflow_dispatch:
concurrency:
# Allow only one workflow per any non-`main` branch.
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.sha || 'anysha' }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-postgres-client-libs:

View File

@@ -716,7 +716,7 @@ impl PageServerHandler {
let _enter = info_span!("get_nblocks", rel = %req.rel, req_lsn = %req.lsn).entered();
let latest_gc_cutoff_lsn = timeline.tline.get_latest_gc_cutoff_lsn();
let lsn = Self::wait_or_get_last_lsn(timeline, req.lsn, req.latest, &latest_gc_cutoff_lsn)?;
assert!(req.latest);
let n_blocks = timeline.get_rel_size(req.rel, lsn)?;
Ok(PagestreamBeMessage::Nblocks(PagestreamNblocksResponse {

View File

@@ -6,7 +6,6 @@ from fixtures.neon_fixtures import NeonEnv, NeonEnvBuilder, NeonPageserverApiExc
#
# Create ancestor branches off the main branch.
#
# @pytest.mark.parametrize("x", range(20))
def test_ancestor_branch(neon_env_builder: NeonEnvBuilder):
env = neon_env_builder.init_start()
@@ -22,7 +21,7 @@ def test_ancestor_branch(neon_env_builder: NeonEnvBuilder):
'compaction_target_size': '4194304',
})
# env.pageserver.safe_psql("failpoints flush-frozen-before-sync=sleep(10000)")
env.pageserver.safe_psql("failpoints flush-frozen-before-sync=sleep(10000)")
pg_branch0 = env.postgres.create_start('main', tenant_id=tenant)
branch0_cur = pg_branch0.connect().cursor()

View File

@@ -1,4 +1,3 @@
import pytest
from fixtures.log_helper import log
from fixtures.neon_fixtures import NeonEnv
from fixtures.utils import lsn_from_hex
@@ -41,7 +40,6 @@ from fixtures.utils import lsn_from_hex
# Because the delta layer D covering lsn1 is corrupted, creating a branch
# starting from lsn1 should return an error as follows:
# could not find data for key ... at LSN ..., for request at LSN ...
# @pytest.mark.skip("")
def test_branch_and_gc(neon_simple_env: NeonEnv):
env = neon_simple_env
@@ -58,9 +56,9 @@ def test_branch_and_gc(neon_simple_env: NeonEnv):
'compaction_target_size': f'{1024 ** 3}',
# tweak the default settings to allow quickly create image layers and L1 layers
'compaction_period': '10 s',
'compaction_period': '1 s',
'compaction_threshold': '2',
'image_creation_threshold': '2',
'image_creation_threshold': '1',
# set PITR interval to be small, so we can do GC
'pitr_interval': '1 s'
@@ -79,9 +77,6 @@ def test_branch_and_gc(neon_simple_env: NeonEnv):
lsn1 = main_cur.fetchone()[0]
log.info(f'LSN1: {lsn1}')
# trigger a manual compaction
env.pageserver.safe_psql(f'''compact {tenant.hex} {timeline_main.hex}''')
main_cur.execute('INSERT INTO foo SELECT FROM generate_series(1, 100000)')
main_cur.execute('SELECT pg_current_wal_insert_lsn()')
lsn2 = main_cur.fetchone()[0]

View File

@@ -44,7 +44,7 @@ def test_branching_with_pgbench(neon_simple_env: NeonEnv,
log.info(f"Start a pgbench workload on pg {connstr}")
pg_bin.run_capture(['pgbench', '-i', f'-s{scale}', connstr])
pg_bin.run_capture(['pgbench', '-T15', connstr])
pg_bin.run_capture(['pgbench', '-c10', '-T15', connstr])
env.neon_cli.create_branch('b0', tenant_id=tenant)
pgs: List[Postgres] = []
@@ -54,24 +54,12 @@ def test_branching_with_pgbench(neon_simple_env: NeonEnv,
threads.append(threading.Thread(target=run_pgbench, args=(pgs[0], ), daemon=True))
threads[-1].start()
thread_limit = 4
for i in range(n_branches):
# random a delay between [0, 5]
delay = random.random() * 5
time.sleep(delay)
log.info(f"Sleep {delay}s")
# If the number of concurrent threads exceeds a threshold,
# wait for all the threads to finish before spawning a new one.
#
# Because tests defined in `batch_others` are run concurrently in CI,
# we want to avoid the situation that one test exhausts resources for other tests.
if len(threads) >= thread_limit:
for thread in threads:
thread.join()
threads = []
if ty == "cascade":
env.neon_cli.create_branch('b{}'.format(i + 1), 'b{}'.format(i), tenant_id=tenant)
else: