Skip to content

Conversation

@joshua-spacetime
Copy link
Collaborator

@joshua-spacetime joshua-spacetime commented Oct 31, 2025

Description of Changes

Refactored st_view_client and renamed it st_view_sub which tracks the number of clients subscribed to a view. On disconnect, we decrement the num_subscribers column in the appropriate rows. An async task will be in charge of cleaning up views (and their read sets) whose subscriber count has gone to zero (not in this patch).

On module init, we clear the entirety of each view table.

API and ABI breaking changes

None. Technically this updates the schema of a system table, but the system table was added and modified between releases.

Expected complexity level and risk

~2

Need to make sure we cover all cases so that we don't leave dangling data. Making these tables ephemeral in the future should simplify this.

Testing

Will add tests once we can subscribe to views

@Centril
Copy link
Contributor

Centril commented Oct 31, 2025

Will add tests once we can subscribe to views

It would be good to have separate datastore-only tests as well to check the logic of the methods you've added to the datastore here.

@joshua-spacetime joshua-spacetime force-pushed the joshua/drop-views-on-disconnect branch from 87acafb to 0a4e9f5 Compare November 5, 2025 22:47
@joshua-spacetime joshua-spacetime force-pushed the joshua/drop-views-on-disconnect branch from a3987a4 to 3d7a395 Compare November 5, 2025 22:54
@joshua-spacetime joshua-spacetime force-pushed the joshua/drop-views-on-disconnect branch from 45626e6 to d58ac9f Compare November 6, 2025 01:23
@joshua-spacetime joshua-spacetime changed the title Clear view tables on disconnect Decrement view subscriber count on disconnect Nov 6, 2025
@joshua-spacetime joshua-spacetime dismissed Centril’s stale review November 6, 2025 07:45

Addressed review comments

@joshua-spacetime joshua-spacetime added this pull request to the merge queue Nov 6, 2025
Merged via the queue into master with commit 30b8eac Nov 6, 2025
25 of 26 checks passed
@joshua-spacetime joshua-spacetime deleted the joshua/drop-views-on-disconnect branch November 6, 2025 08:52
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.

4 participants