Skip to content

Separate instance_client and more precise error types#34839

Open
ggevay wants to merge 3 commits intoMaterializeInc:mainfrom
ggevay:instance_client-refactoring
Open

Separate instance_client and more precise error types#34839
ggevay wants to merge 3 commits intoMaterializeInc:mainfrom
ggevay:instance_client-refactoring

Conversation

@ggevay
Copy link
Contributor

@ggevay ggevay commented Jan 27, 2026

This is a refactoring related to the frontend peek sequencing, addressing the second paragraph of #33713 (comment) + other related discussions with Moritz and Jan.

It's split into commits meaningfully. (I could also split it up to into multiple PRs if desired.)

The first commit is just code movement, moving out the Client from instance.rs into a new file instance_client.rs, and renaming it to InstanceClient. (This is used by the frontend peek sequencing directly, bypassing the ComputeController, because we don't want the Coordinator to be a bottleneck for fast-path peeks.)

The second commit makes many function return types specify more precise error types. This made CollectionLookupError used only by PeekClient, so I moved it there.

The third commit just resolves some of the /// TODO(database-issues#7533): Add documentation. comments in controller/error.rs.

@ggevay ggevay added A-controller Area: controllers A-CLUSTER Topics related to the CLUSTER layer labels Jan 27, 2026
@ggevay ggevay force-pushed the instance_client-refactoring branch from b9f1c71 to cade330 Compare January 27, 2026 17:29
@ggevay ggevay added the A-ADAPTER Topics related to the ADAPTER layer label Jan 27, 2026
@ggevay ggevay changed the title controller: Separate instance_client Separate instance_client and more precise error types Jan 27, 2026
@ggevay ggevay force-pushed the instance_client-refactoring branch 3 times, most recently from 61efcbb to cccab47 Compare January 27, 2026 18:11
@ggevay ggevay force-pushed the instance_client-refactoring branch 2 times, most recently from 879eebb to ef2a3ce Compare January 27, 2026 18:25
@ggevay ggevay force-pushed the instance_client-refactoring branch from ef2a3ce to 8cc1475 Compare January 27, 2026 18:27
@ggevay ggevay marked this pull request as ready for review January 27, 2026 18:29
@ggevay ggevay requested review from a team as code owners January 27, 2026 18:29
@ggevay ggevay requested review from SangJunBak, antiguru and teskje and removed request for SangJunBak January 27, 2026 18:29
Copy link
Member

@antiguru antiguru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind splitting the PR in three? It's distinct changes and would be easier to review if they're separate.

The client change seems to be purely code movement, I'm not sure it's actually worth doing.

@ggevay
Copy link
Contributor Author

ggevay commented Feb 12, 2026

@antiguru, moving stuff into a new instance_client.rs was @teskje's idea, see here. I'm fine either way.

@teskje
Copy link
Contributor

teskje commented Feb 13, 2026

Yeah, the intention is twofold:

  • Having a separate module for the public instance client allows us to keep the instance module private, which makes it easier to ensure that we don't expose more of its contents over time.
  • Some of the errors returned by InstanceClient are similar, but different to errors returned by the Instance task (in instance.rs) or errors returned by the ComputeController client (in error.rs). Having a separate module gives us a place to define the InstanceClient errors without running into name conflicts.

@ggevay
Copy link
Contributor Author

ggevay commented Feb 13, 2026

Ok, separated into 3 PRs: #35010, #35011, #35012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ADAPTER Topics related to the ADAPTER layer A-CLUSTER Topics related to the CLUSTER layer A-controller Area: controllers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants