Skip to content

Conversation

@SarahFrench
Copy link
Member

@SarahFrench SarahFrench commented Nov 14, 2025

I realised that the code for calling RPC methods had leaked through the code further than intended, so this PR updates calling code in Meta methods and ensures that configuring a state store is only done via the backend.Backend interface.

Target Release

1.15.x

Rollback Plan

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

@SarahFrench SarahFrench added the no-changelog-needed Add this to your PR if the change does not require a changelog entry label Nov 14, 2025
…tead of an instance of the `backend.Backend` interface.
…e, instead of directly using methods related to RPCs. This requires changing where we call `SetStateStoreChunkSize`.
To summarize, we don't really need the `SetStateStoreChunkSize` method, and instead methods like `(*GRPCProvider).ConfigureStateStore` in the `plugin6` package can directly inspect the negotiation process that passes through that code and pull out the chunk size. However that means that that code would also need to implement validation. And that's just `(*GRPCProvider).ConfigureStateStore`; what about all the test mocks that are used in different types of test? They would all need to be implemented similarly to GRPCProvider to be good, useful mocks, and then a lot of things that fulfil the provider.Interface interface are coupled to each other. Instead, it's easier to have validation in the `grpcClient` struct's methods in the `remote` package, as that code is common to all scenarios. That code needs a method to 'reach into'  the provider.Interface value, so we use the `SetStateStoreChunkSize` method.
@SarahFrench SarahFrench force-pushed the pss/use-interface-configure-store branch from 97dd6bf to a38298d Compare November 14, 2025 20:47
I'm surprised that removing this doesn't break E2E tests of PSS that use grpcwrap, but I think there's `plugin6` code that runs in that situation, so maybe chunking is handled elsewhere.
@SarahFrench
Copy link
Member Author

f848219 did its job by highlighting the changes needed in a8f76c1 🥲

if cs, ok := p.provider.(providers.StateStoreChunkSizeSetter); ok {
cs.SetStateStoreChunkSize(p.typeName, int(chunkSize))
} else {
// TODO: Remove
Copy link
Member Author

Choose a reason for hiding this comment

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

It feels like leaving this in would be helpful, any objections?

Copy link
Member

Choose a reason for hiding this comment

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

We could also avoid the _, ok notation above and let it panic that way. I think it's merely a question of how likely this is ever to happen and be exposed to the end user.

Personally, I like panic to be a direct side effect of a problem rather than intention where it is possible (i.e. I'd rather let the casting panic) and leaving it to Go to express itself but I do not hold that opinion too strongly. 🤷🏻

Copy link
Member Author

Choose a reason for hiding this comment

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

That makes sense - I'll push a change for this

@SarahFrench SarahFrench marked this pull request as ready for review November 17, 2025 16:40
@SarahFrench SarahFrench requested a review from a team as a code owner November 17, 2025 16:40
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

No major reservations except for the missing validation method.

if cs, ok := p.provider.(providers.StateStoreChunkSizeSetter); ok {
cs.SetStateStoreChunkSize(p.typeName, int(chunkSize))
} else {
// TODO: Remove
Copy link
Member

Choose a reason for hiding this comment

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

We could also avoid the _, ok notation above and let it panic that way. I think it's merely a question of how likely this is ever to happen and be exposed to the end user.

Personally, I like panic to be a direct side effect of a problem rather than intention where it is possible (i.e. I'd rather let the casting panic) and leaving it to Go to express itself but I do not hold that opinion too strongly. 🤷🏻

@SarahFrench SarahFrench merged commit cf047be into main Nov 26, 2025
15 checks passed
@SarahFrench SarahFrench deleted the pss/use-interface-configure-store branch November 26, 2025 13:34
SarahFrench added a commit that referenced this pull request Nov 26, 2025
…using grpcwrap package

This was removed, incorrectly, in #37899
SarahFrench added a commit that referenced this pull request Dec 4, 2025
…using grpcwrap package

This was removed, incorrectly, in #37899
SarahFrench added a commit that referenced this pull request Dec 4, 2025
…using grpcwrap package

This was removed, incorrectly, in #37899
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog-needed Add this to your PR if the change does not require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants