Skip to content

Conversation

@jsha
Copy link
Contributor

@jsha jsha commented Oct 25, 2025

The orders table gets a new column authzs, containing a protobuf-encoded list of authorization IDs as int64s. Storing this data directly in the orders table will allow us to get rid of the orderToAuthz2 table, which is large (#8451).

There's a new feature flag, StoreAuthzsInTheOrder, which controls whether the SA expects the new column to exist. The SA gracefully handles the case where the new column is NULL, by querying the orderToAuthz2 table. Eventually all valid orders will have a non-NULL authzs column and we can remove the fallback.

@jsha jsha marked this pull request as ready for review October 27, 2025 20:18
@jsha jsha requested a review from a team as a code owner October 27, 2025 20:18
@jsha jsha requested a review from aarongable October 27, 2025 20:18
@github-actions
Copy link
Contributor

@jsha, this PR appears to contain configuration and/or SQL schema changes. Please ensure that a corresponding deployment ticket has been filed with the new values.

@github-actions
Copy link
Contributor

@jsha, this PR adds one or more new feature flags: StoreAuthzsInTheOrder. As such, this PR must be accompanied by a review of the Let's Encrypt CP/CPS to ensure that our behavior both before and after this flag is flipped is compliant with that document.

Please conduct such a review, then add your findings to the PR description in a paragraph beginning with "CPS Compliance Review:".

Copy link
Contributor

@aarongable aarongable left a comment

Choose a reason for hiding this comment

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

Sorry I didn't review this immediately! It got completely lost in the shuffle.

I think this whole PR can be simplified: specifically, I don't think there's a need for a whole new orderModelWithAuthzs type. We can see a similar example in #8056, where we added a new Replaces DEFAULT NULL column, but were able to just integrate it directly into the existing type.

The key is using the feature flag to determine whether we call borp's SetTransient method, which tells it not to specifically list that column when generating column names for SELECT statements. This means that the tx.Get in saro.go doesn't have to supply different types depending on whether the feature flag is on or off; borp will handle eliding the column name when the flag is off automatically. And it means that the tx.Insert in sa.go can simply condition whether it populates the Authzs field on the feature flag, instead of having to use two whole different types. And of course it means that modelToOrder doesn't need a top-level branch.

Comment on lines +451 to +454
// Used internally for storage in the DB, not for RPCs.
message Authzs {
repeated int64 authzIDs = 1;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I'd break this out into a separate file, but maybe that plays havoc with our generate.sh.

// StoreAuthzsInTheOrder causes the SA to write to the `authzs`
// column in NewOrder and read from it in GetOrder. It should be enabled
// after the migration to add that column has been run.
StoreAuthzsInTheOrder bool
Copy link
Contributor

Choose a reason for hiding this comment

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

Hyper-nit: the name of this flag feels incongruous next to StoreReplacesInOrders, which is semantically indicating the exact same type of change, but uses "Orders" instead of "TheOrder".

@aarongable aarongable requested review from a team and jprenken and removed request for a team November 11, 2025 00:45
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