Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set heartbeat interval for chaos test #10222

Merged
merged 10 commits into from
Jan 2, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix formatting
  • Loading branch information
Konstantin Knizhnik committed Dec 20, 2024
commit 2ea6f7fee1f82166eacdfd2aaec85a301a83abf5
68 changes: 38 additions & 30 deletions pageserver/src/page_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,12 +552,12 @@ impl std::fmt::Display for BatchedPageStreamError {
}

struct BatchedGetPageRequest {
rel: RelTag,
blkno: BlockNumber,
rel: RelTag,
blkno: BlockNumber,
reqid: RequestId,
request_lsn: Lsn,
not_modified_since: Lsn,
timer: SmgrOpTimer,
timer: SmgrOpTimer,
}

enum BatchedFeMessage {
Expand Down Expand Up @@ -863,8 +863,13 @@ impl PageServerHandler {
shard,
effective_request_lsn,
pages: smallvec::smallvec![BatchedGetPageRequest {
rel, blkno, reqid, request_lsn, not_modified_since, timer
}],
rel,
blkno,
reqid,
request_lsn,
not_modified_since,
timer
}],
}
}
};
Expand Down Expand Up @@ -1227,7 +1232,7 @@ impl PageServerHandler {
request_span,
pipelining_config,
protocol_version,
&ctx,
&ctx,
)
.await
}
Expand All @@ -1240,7 +1245,7 @@ impl PageServerHandler {
timeline_handles,
request_span,
protocol_version,
&ctx,
&ctx,
)
.await
}
Expand Down Expand Up @@ -1758,29 +1763,32 @@ impl PageServerHandler {
assert_eq!(results.len(), requests.len());

// TODO: avoid creating the new Vec here
Vec::from_iter(requests.into_iter().zip(results.into_iter()).map(
|(req, res)| {
res.map(|page| {
(
PagestreamBeMessage::GetPage(models::PagestreamGetPageResponse {
reqid: req.reqid,
request_lsn: req.request_lsn,
not_modified_since: req.not_modified_since,
rel: req.rel,
blkno: req.blkno,
page,
}),
req.timer,
)
})
.map_err(|e| BatchedPageStreamError {
err: PageStreamError::from(e),
reqid: req.reqid,
request_lsn: req.request_lsn,
not_modified_since: req.not_modified_since,
})
},
))
Vec::from_iter(
requests
.into_iter()
.zip(results.into_iter())
.map(|(req, res)| {
res.map(|page| {
(
PagestreamBeMessage::GetPage(models::PagestreamGetPageResponse {
reqid: req.reqid,
request_lsn: req.request_lsn,
not_modified_since: req.not_modified_since,
rel: req.rel,
blkno: req.blkno,
page,
}),
req.timer,
)
})
.map_err(|e| BatchedPageStreamError {
err: PageStreamError::from(e),
reqid: req.reqid,
request_lsn: req.request_lsn,
not_modified_since: req.not_modified_since,
})
}),
)
}

#[instrument(skip_all, fields(shard_id))]
Expand Down