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

storage: differentiate between append-only and incremental storage-managed collections #27496

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/adapter/src/coord/message_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ impl Coordinator {
Message::PrivateLinkVpcEndpointEvents(events) => {
self.controller
.storage
.record_introspection_updates(
.append_introspection_updates(
mz_storage_client::controller::IntrospectionType::PrivatelinkConnectionStatusHistory,
events
.into_iter()
Expand Down
2 changes: 1 addition & 1 deletion src/adapter/src/coord/statement_logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ impl Coordinator {
] {
self.controller
.storage
.record_introspection_updates(type_, updates)
.append_introspection_updates(type_, updates)
.await;
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/compute-client/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,9 @@ where

for (type_, updates) in updates_by_type {
if !updates.is_empty() {
storage.record_introspection_updates(type_, updates).await;
storage
.update_introspection_collection(type_, updates)
.await;
}
}
}
Expand Down
18 changes: 14 additions & 4 deletions src/storage-client/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,11 +661,21 @@ pub trait StorageController: Debug {
external_frontiers: BTreeMap<(GlobalId, ReplicaId), Antichain<Self::Timestamp>>,
);

/// Records updates for the given introspection type.
/// Records append-only updates for the given introspection type.
///
/// Rows passed in `updates` MUST have the correct schema for the given introspection type,
/// as readers rely on this and might panic otherwise.
async fn record_introspection_updates(
/// Rows passed in `updates` MUST have the correct schema for the given
/// introspection type, as readers rely on this and might panic otherwise.
async fn append_introspection_updates(
&mut self,
type_: IntrospectionType,
updates: Vec<(Row, Diff)>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should replace the Diff here with u64, to make the type system ensure that this doesn't have retractions.

);

/// Updates the desired state of the given introspection type.
///
/// Rows passed in `updates` MUST have the correct schema for the given
/// introspection type, as readers rely on this and might panic otherwise.
async fn update_introspection_collection(
&mut self,
type_: IntrospectionType,
updates: Vec<(Row, Diff)>,
Expand Down
Loading