Repository navigation
feat: one wiring, built once, handed back by name - #34
Closed
AlexeyShalaev wants to merge 1 commit into
Closed
AlexeyShalaev wants to merge 1 commit into
AlexeyShalaev wants to merge 1 commit into
Conversation
Three settings live on two objects and have to agree: marker_prefix, which one writes and the other looks for; ddl_timezone, which one writes naive boundary literals in and the other reads them back in -- on constructors that do not even default to the same value -- and boundary_codec. Passing one of them to one object only is silent: detached partitions simply stop being seen, so they are never dropped. PartitionToolkit.from_engine takes each of those once and builds the repository, the provider, the locks, the service and the maintainer around one engine. It returns the parts, not just a maintainer, so code calling metadata.is_partition_closed or locks.acquire_lock directly does not build a second set and keep it consistent by hand.
This was referenced Sep 1, 2026
Member
Author
|
Folded into #43, one PR for the whole epic; this branch stays for history. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second piece of #32, and the other half of #27 — the construction helper.
Three settings live on two objects and have to agree, and passing one of them to one object only is silent:
marker_prefix— the repository stamps it on detach and reads it back before a drop; the metadata provider looks for it when discovering orphans. Give it to one only and detached partitions are never seen again, so they are never dropped.ddl_timezone— one writes naive boundary literals in it, the other reads them back in it, and the two constructors do not even default to the same value ("UTC"on the repository,Noneon the provider). So "I passed nothing" used to mean a reader on a timezone the writer never used.from_enginenow gives both"UTC".boundary_codec.PartitionToolkit.from_engine(engine, ...)takes each of those once and returnsrepo/metadata/locks/service/maintainer. Parts rather than just a maintainer, so code callingmetadata.is_partition_closedorlocks.acquire_lockdirectly does not build a second set and keep it consistent by hand.PartitionToolkit(...)can be constructed directly around parts of your own.Both mirrors, 16 tests. The getting-started page keeps the hand-wiring as the explanation and uses the toolkit from there on.
Stacked on #33.