storage: rename term -> last_log_term in TimelineMembershipSwitchResponse (#12481)

## Problem
Names are not consistent between safekeeper migration RFC and the actual
implementation.

It's not used anywhere in production yet, so it's safe to rename. We
don't need to worry about backward compatibility.

- Follow up on https://github.com/neondatabase/neon/pull/12432

## Summary of changes
- rename term -> last_log_term in TimelineMembershipSwitchResponse 
- add missing fields to TimelineMembershipSwitchResponse in python
This commit is contained in:
Dmitrii Kovalkov
2025-07-07 13:22:03 +04:00
committed by GitHub
parent 4b5c75b52f
commit fc10bb9438
5 changed files with 13 additions and 7 deletions

View File

@@ -112,12 +112,18 @@ class TimelineCreateRequest:
class TimelineMembershipSwitchResponse:
previous_conf: MembershipConfiguration
current_conf: MembershipConfiguration
last_log_term: int
flush_lsn: Lsn
@classmethod
def from_json(cls, d: dict[str, Any]) -> TimelineMembershipSwitchResponse:
previous_conf = MembershipConfiguration.from_json(d["previous_conf"])
current_conf = MembershipConfiguration.from_json(d["current_conf"])
return TimelineMembershipSwitchResponse(previous_conf, current_conf)
last_log_term = d["last_log_term"]
flush_lsn = Lsn(d["flush_lsn"])
return TimelineMembershipSwitchResponse(
previous_conf, current_conf, last_log_term, flush_lsn
)
class SafekeeperHttpClient(requests.Session, MetricsGetter):