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

@@ -2371,7 +2371,7 @@ pub fn make_router(
named_request_span(
r,
handle_safekeeper_scheduling_policy,
RequestName("v1_safekeeper_status"),
RequestName("v1_safekeeper_scheduling_policy"),
)
})
// Tenant Shard operations

View File

@@ -914,13 +914,13 @@ impl Service {
// so it isn't counted toward the quorum.
if let Some(min_position) = min_position {
if let Ok(ok_res) = &res {
if (ok_res.term, ok_res.flush_lsn) < min_position {
if (ok_res.last_log_term, ok_res.flush_lsn) < min_position {
// Use Error::Timeout to make this error retriable.
res = Err(mgmt_api::Error::Timeout(
format!(
"safekeeper {} returned position {:?} which is less than minimum required position {:?}",
client.node_id_label(),
(ok_res.term, ok_res.flush_lsn),
(ok_res.last_log_term, ok_res.flush_lsn),
min_position
)
));
@@ -1216,7 +1216,7 @@ impl Service {
let mut sync_position = (INITIAL_TERM, Lsn::INVALID);
for res in results.into_iter().flatten() {
let sk_position = (res.term, res.flush_lsn);
let sk_position = (res.last_log_term, res.flush_lsn);
if sync_position < sk_position {
sync_position = sk_position;
}