diff --git a/safekeeper/src/timelines_global_map.rs b/safekeeper/src/timelines_global_map.rs index fd5f010b3d..66e0145042 100644 --- a/safekeeper/src/timelines_global_map.rs +++ b/safekeeper/src/timelines_global_map.rs @@ -279,7 +279,9 @@ impl GlobalTimelines { let (dir_existed, was_active) = timeline.delete_from_disk(&mut shared_state)?; // Remove timeline from the map. - TIMELINES_STATE.lock().unwrap().timelines.remove(ttid); + // FIXME: re-enable it once we fix the issue with recreation of deleted timelines + // https://github.com/neondatabase/neon/issues/3146 + // TIMELINES_STATE.lock().unwrap().timelines.remove(ttid); Ok(TimelineDeleteForceResult { dir_existed, @@ -346,15 +348,16 @@ impl GlobalTimelines { .tenant_dir(tenant_id), )?; - let tlis_after_delete = Self::get_all_for_tenant(*tenant_id); - if !tlis_after_delete.is_empty() { - // Some timelines were created while we were deleting them, returning error - // to the caller, so it can retry later. - bail!( - "failed to delete all timelines for tenant {}: some timelines were created while we were deleting them", - tenant_id - ); - } + // FIXME: we temporarily disabled removing timelines from the map, see `delete_force` + // let tlis_after_delete = Self::get_all_for_tenant(*tenant_id); + // if !tlis_after_delete.is_empty() { + // // Some timelines were created while we were deleting them, returning error + // // to the caller, so it can retry later. + // bail!( + // "failed to delete all timelines for tenant {}: some timelines were created while we were deleting them", + // tenant_id + // ); + // } Ok(deleted) } diff --git a/test_runner/regress/test_wal_acceptor.py b/test_runner/regress/test_wal_acceptor.py index 72d27c3aba..9e3b0ec02f 100644 --- a/test_runner/regress/test_wal_acceptor.py +++ b/test_runner/regress/test_wal_acceptor.py @@ -567,6 +567,8 @@ def test_s3_wal_replay(neon_env_builder: NeonEnvBuilder, remote_storage_kind: Re for sk in env.safekeepers: cli = sk.http_client() cli.timeline_delete_force(tenant_id, timeline_id) + # restart safekeeper to clear its in-memory state + sk.stop().start() cli.timeline_create(tenant_id, timeline_id, pg_version, last_lsn) f_partial_path = ( Path(sk.data_dir()) / str(tenant_id) / str(timeline_id) / f_partial_saved.name @@ -1105,6 +1107,7 @@ def test_delete_force(neon_env_builder: NeonEnvBuilder, auth_enabled: bool): env.pageserver.allowed_errors.extend( [ ".*Failed to process query for timeline .*: Timeline .* was not found in global map.*", + ".*Failed to process query for timeline .*: Timeline .* was cancelled and cannot be used anymore.*", ] ) @@ -1205,7 +1208,7 @@ def test_delete_force(neon_env_builder: NeonEnvBuilder, auth_enabled: bool): # Remove initial tenant again. response = sk_http.tenant_delete_force(tenant_id) - assert response == {} + # assert response == {} assert not (sk_data_dir / str(tenant_id)).exists() assert (sk_data_dir / str(tenant_id_other) / str(timeline_id_other)).is_dir()