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

Shub/st connected clients #1288

Merged
merged 8 commits into from
May 24, 2024
Merged

Shub/st connected clients #1288

merged 8 commits into from
May 24, 2024

Conversation

Shubham8287
Copy link
Contributor

@Shubham8287 Shubham8287 commented May 23, 2024

Description of Changes

  • new st_clients table to keep track of connected clients.
  • Insert happens with the __identity_connect__ reducer transaction.
  • Deletion is independent of the disconnect reducer result hence happen in different tx.

API and ABI breaking changes

N/A

Expected complexity level and risk

2

Testing

  • Done via quickstart-chat app.

@Shubham8287 Shubham8287 self-assigned this May 23, 2024
@Shubham8287 Shubham8287 marked this pull request as draft May 23, 2024 13:49
@Shubham8287 Shubham8287 marked this pull request as ready for review May 24, 2024 08:49
Copy link
Contributor

@kim kim left a comment

Choose a reason for hiding this comment

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

Looks good!

Modulo docs + system schema tests.

crates/core/src/host/module_host.rs Show resolved Hide resolved
crates/core/src/host/module_host.rs Outdated Show resolved Hide resolved
Comment on lines +754 to +760
.iter_by_col_eq_mut(
ctx,
mut_tx,
ST_CLIENTS_ID,
col_list![StClientsFields::Identity, StClientsFields::Address],
&algebraic_value::AlgebraicValue::product(row),
)?
Copy link
Contributor

Choose a reason for hiding this comment

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

@cloutiertyler I feel like this makes #1287 and #1097 more of a priority as we are comparing against:

product![product![AlgebraicValue::Bytes(vec![...].into())], product![AlgebraicValue::Bytes(vec![...].into())]]

as opposed to:

product![AlgebraicValue::U256(Box::new(...)), AlgebraicValue::U128(...)]

@Shubham8287 Shubham8287 added this pull request to the merge queue May 24, 2024
@Shubham8287 Shubham8287 removed this pull request from the merge queue due to a manual request May 24, 2024
@Shubham8287 Shubham8287 added this pull request to the merge queue May 24, 2024
@Shubham8287 Shubham8287 linked an issue May 24, 2024 that may be closed by this pull request
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 24, 2024
@Shubham8287 Shubham8287 added this pull request to the merge queue May 24, 2024
Merged via the queue into master with commit 8ecee76 May 24, 2024
6 checks passed
@kim kim mentioned this pull request Jun 6, 2024
6 tasks
kim added a commit that referenced this pull request Jun 11, 2024
When opening a `RelationalDB`, determine the set of dangling clients
(`ConnectedClients`) by scanning the `st_clients` table instead of
tracking unmatched `__identity_connected__` calls during history replay.

We left the replay tracking in place in #1288, treating the commitlog as
the sole source of truth. With #1344 (snapshotting), this is no longer
correct: the snapshot may contain rows in `st_clients`, but leave no
history suffix for replay.
Centril pushed a commit that referenced this pull request Jun 11, 2024
When opening a `RelationalDB`, determine the set of dangling clients
(`ConnectedClients`) by scanning the `st_clients` table instead of
tracking unmatched `__identity_connected__` calls during history replay.

We left the replay tracking in place in #1288, treating the commitlog as
the sole source of truth. With #1344 (snapshotting), this is no longer
correct: the snapshot may contain rows in `st_clients`, but leave no
history suffix for replay.
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.

Define st_connected_clients table
3 participants