From 63dd7bce7ec97cb6442aecb74c8843d77e119f65 Mon Sep 17 00:00:00 2001 From: Dmitry Rodionov Date: Wed, 26 Jan 2022 17:50:21 +0300 Subject: [PATCH] bandaid to avoid concurrent timeline downloading until proper refactoring/fix --- pageserver/src/layered_repository/image_layer.rs | 9 ++++++++- test_runner/batch_others/test_remote_storage.py | 7 ++++++- test_runner/batch_others/test_tenant_relocation.py | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pageserver/src/layered_repository/image_layer.rs b/pageserver/src/layered_repository/image_layer.rs index ecfb8c73b0..33311f896b 100644 --- a/pageserver/src/layered_repository/image_layer.rs +++ b/pageserver/src/layered_repository/image_layer.rs @@ -173,7 +173,14 @@ impl Layer for ImageLayer { .as_ref() .unwrap() .chapter_reader(BLOCKY_IMAGES_CHAPTER)?; - chapter.read_exact_at(&mut buf, offset)?; + + chapter.read_exact_at(&mut buf, offset).with_context(|| { + format!( + "failed to read page from data file {} at offset {}", + self.filename().display(), + offset + ) + })?; buf } diff --git a/test_runner/batch_others/test_remote_storage.py b/test_runner/batch_others/test_remote_storage.py index 3ce73c7e61..6698142c09 100644 --- a/test_runner/batch_others/test_remote_storage.py +++ b/test_runner/batch_others/test_remote_storage.py @@ -74,8 +74,13 @@ def test_remote_storage_backup_and_restore(zenith_env_builder: ZenithEnvBuilder, ##### Second start, restore the data and ensure it's the same env.pageserver.start() - log.info("waiting for timeline redownload") client = env.pageserver.http_client() + client.timeline_attach(UUID(tenant_id), UUID(timeline_id)) + # FIXME cannot handle duplicate download requests (which might be caused by repeated timeline detail calls) + # subject to fix in https://github.com/zenithdb/zenith/issues/997 + time.sleep(5) + + log.info("waiting for timeline redownload") attempts = 0 while True: timeline_details = client.timeline_detail(UUID(tenant_id), UUID(timeline_id)) diff --git a/test_runner/batch_others/test_tenant_relocation.py b/test_runner/batch_others/test_tenant_relocation.py index 1eb4fe1a29..1d1dde0697 100644 --- a/test_runner/batch_others/test_tenant_relocation.py +++ b/test_runner/batch_others/test_tenant_relocation.py @@ -192,7 +192,7 @@ def test_tenant_relocation(zenith_env_builder: ZenithEnvBuilder, new_pageserver_pg_port, new_pageserver_http_port): - # call to attach timeline to new timeline + # call to attach timeline to new pageserver new_pageserver_http_client.timeline_attach(UUID(tenant), UUID(timeline)) # FIXME cannot handle duplicate download requests, subject to fix in https://github.com/zenithdb/zenith/issues/997 time.sleep(5)