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

refactor(rtc): remove the duplicate IndexLayerMetadata #7860

Merged
merged 6 commits into from
May 23, 2024

Conversation

koivunej
Copy link
Member

@koivunej koivunej commented May 23, 2024

Once upon a time, we used to have duplicated types for runtime IndexPart and whatever we stored. Because of the serde fixes in #5335 we have no need for duplicated IndexPart type anymore, but the IndexLayerMetadata stayed.

  • remove the type
  • remove LayerFileMetadata::file_size() in favor of direct field access

Split off from #7833. Cc: #3072.

@koivunej koivunej requested a review from arpad-m May 23, 2024 11:24
Copy link

3108 tests run: 2981 passed, 0 failed, 127 skipped (full report)


Flaky tests (2)

Postgres 16

  • test_crafted_wal_end[wal_record_crossing_segment_followed_by_small_one]: debug
  • test_vm_bit_clear_on_heap_lock: debug

Code coverage* (full report)

  • functions: 31.4% (6446 of 20540 functions)
  • lines: 48.3% (49853 of 103245 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
16a880f at 2024-05-23T13:02:13.800Z :recycle:

@koivunej koivunej marked this pull request as ready for review May 23, 2024 19:36
@koivunej koivunej requested a review from a team as a code owner May 23, 2024 19:36
@koivunej koivunej requested a review from arssher May 23, 2024 19:36
@koivunej koivunej merged commit 7cf726e into main May 23, 2024
65 checks passed
@koivunej koivunej deleted the joonas/refactor_rtc_one_metadata branch May 23, 2024 20:24
koivunej added a commit that referenced this pull request Jun 4, 2024
RemoteTimelineClient maintains a copy of "next IndexPart" as a number of
fields which are like an IndexPart but this is not immediately obvious.
Instead of multiple fields, maintain a `dirty` ("next IndexPart") and
`clean` ("uploaded IndexPart") fields.

Additional cleanup:
- rename `IndexPart::disk_consistent_lsn` accessor
`duplicated_disk_consistent_lsn`
- no one except scrubber should be looking at it, even scrubber is a
stretch
- remove usage elsewhere (pagectl used by tests, metadata scan endpoint)
- serialize index part *before* the index upload operation
- avoid upload operation being retried because of serialization error
- serialization error is fatal anyway for timeline -- it can only make
transient local progress after that, at least the error is bubbled up
now
- gather exploded IndexPart fields into single actual
`UploadQueueInitialized::dirty` of which the uploaded snapshot is
serialized
- implement the long wished monotonicity check with the `clean`
IndexPart with an assertion which is not expected to fire

Continued work from #7860 towards next step of #6994.
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.

2 participants