feat(pageserver): add force patch index_part API (#11119)

## Problem

As part of the disaster recovery tool. Partly for
https://github.com/neondatabase/neon/issues/9114.

## Summary of changes

* Add a new pageserver API to force patch the fields in index_part and
modify the timeline internal structures.

---------

Signed-off-by: Alex Chi Z <chi@neon.tech>
This commit is contained in:
Alex Chi Z.
2025-03-07 12:42:52 -05:00
committed by GitHub
parent e876794ce5
commit cd438406fb
5 changed files with 129 additions and 2 deletions
+13
View File
@@ -375,6 +375,19 @@ class PageserverHttpClient(requests.Session, MetricsGetter):
res = self.post(f"http://localhost:{self.port}/v1/tenant/{tenant_id}/reset", params=params)
self.verbose_error(res)
def timeline_patch_index_part(
self,
tenant_id: TenantId | TenantShardId,
timeline_id: TimelineId,
data: dict[str, Any],
):
res = self.post(
f"http://localhost:{self.port}/v1/tenant/{tenant_id}/timeline/{timeline_id}/patch_index_part",
json=data,
)
self.verbose_error(res)
return res.json()
def tenant_location_conf(
self,
tenant_id: TenantId | TenantShardId,