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

debug_tool: get page at lsn and keyspace via http api #5057

Merged
merged 5 commits into from
Oct 6, 2023

Conversation

koivunej
Copy link
Member

@koivunej koivunej commented Aug 21, 2023

If there are any layermap or layer file related problems, having a reproducable get_page@lsn easily usable for fast debugging iteration is helpful.

Split off from #4938.

Later evolved to add http apis for:

  • get_page@lsn at /v1/tenant/:tenant_id/timeline/:timeline_id/get?key=<hex>&lsn=<lsn string>
  • collecting the keyspace at /v1/tenant/:tenant_id/timeline/:timeline_id/keyspace?[at_lsn=<lsn string>]
    • defaults to last_record_lsn

collecting the keyspace seems to yield some ranges for which there is no key.

@hlinnaka
Copy link
Contributor

As a side note, we have a similar function called get_raw_page_at_lsn in the neon_test_utils postgres extension. But doesn't hurt to have it also in the HTTP API, I can see that being useful.

@github-actions
Copy link

github-actions bot commented Aug 21, 2023

2250 tests run: 2134 passed, 0 failed, 116 skipped (full report)


Code coverage (full report)

  • functions: 52.3% (8122 of 15525 functions)
  • lines: 81.1% (47498 of 58593 lines)

The comment gets automatically updated with the latest test results
33a89bf at 2023-10-06T11:13:36.755Z :recycle:

@koivunej
Copy link
Member Author

koivunej commented Aug 22, 2023

As a side note, we have a similar function called get_raw_page_at_lsn in the neon_test_utils postgres extension. But doesn't hurt to have it also in the HTTP API, I can see that being useful.

This one does not even return the actual page. So I guess it could/should be going that. application/octet-stream, will add that response later.

EDIT: application/octet-stream now added.

@koivunej koivunej changed the title debug_tool: get page at lsn http api debug_tool: get page at lsn and partitioning via http api Oct 3, 2023
@koivunej koivunej marked this pull request as ready for review October 3, 2023 16:44
@koivunej koivunej requested a review from a team as a code owner October 3, 2023 16:44
@koivunej koivunej requested review from hlinnaka and removed request for a team October 3, 2023 16:44
@koivunej koivunej changed the title debug_tool: get page at lsn and partitioning via http api debug_tool: get page at lsn and keyspace via http api Oct 3, 2023
@koivunej
Copy link
Member Author

koivunej commented Oct 3, 2023

Accompanying stresser: https://gist.github.com/koivunej/d6e3d7c21dff88b429b84f1172453ab1 I don't want to develop it in tree because compilation times.

koivunej and others added 5 commits October 6, 2023 10:35
botched rebase: includes partitioning
partitioning is no longer used because it's split, and outside you don't
need to know about the split.
@koivunej koivunej enabled auto-merge (squash) October 6, 2023 10:48
@koivunej koivunej merged commit 45f98dd into main Oct 6, 2023
39 checks passed
@koivunej koivunej deleted the remove_remote_layer_3 branch October 6, 2023 11:17
koivunej added a commit that referenced this pull request Oct 26, 2023
…#4938)

Implement a new `struct Layer` abstraction which manages downloadness
internally, requiring no LayerMap locking or rewriting to download or
evict providing a property "you have a layer, you can read it". The new
`struct Layer` provides ability to keep the file resident via a RAII
structure for new layers which still need to be uploaded. Previous
solution solved this `RemoteTimelineClient::wait_completion` which lead
to bugs like #5639. Evicting or the final local deletion after garbage
collection is done using Arc'd value `Drop`.

With a single `struct Layer` the closed open ended `trait Layer`, `trait
PersistentLayer` and `struct RemoteLayer` are removed following noting
that compaction could be simplified by simply not using any of the
traits in between: #4839.

The new `struct Layer` is a preliminary to remove
`Timeline::layer_removal_cs` documented in #4745.

Preliminaries: #4936, #4937, #5013, #5014, #5022, #5033, #5044, #5058,
#5059, #5061, #5074, #5103, epic #5172, #5645, #5649. Related split off:
#5057, #5134.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants