Skip to content

Add richer Follower interface enabling clean shutdown & stats#544

Merged
AlCutter merged 7 commits into
transparency-dev:mainfrom
AlCutter:migration_follower_waiting
Mar 20, 2025
Merged

Add richer Follower interface enabling clean shutdown & stats#544
AlCutter merged 7 commits into
transparency-dev:mainfrom
AlCutter:migration_follower_waiting

Conversation

@AlCutter

@AlCutter AlCutter commented Mar 19, 2025

Copy link
Copy Markdown
Collaborator

This PR defines a Follower interface which enables Tessera to know when it's safe to exit, e.g. during migration, we need to potentially wait for the antispam index to be fully populated.

Towards #436

@AlCutter AlCutter added the enhancement New feature or request label Mar 19, 2025
@AlCutter AlCutter added this to the beta milestone Mar 19, 2025
@AlCutter AlCutter force-pushed the migration_follower_waiting branch 3 times, most recently from 016fdf3 to 2758554 Compare March 19, 2025 12:17
@AlCutter AlCutter changed the title Add richer Follower interface allowing clean shutdown Add richer Follower interface enabling clean shutdown Mar 19, 2025
@AlCutter AlCutter changed the title Add richer Follower interface enabling clean shutdown Add richer Follower interface enabling clean shutdown & stats Mar 19, 2025
@AlCutter AlCutter requested a review from mhutchinson March 19, 2025 13:17
@AlCutter AlCutter force-pushed the migration_follower_waiting branch from 2758554 to 7d6ff40 Compare March 19, 2025 14:16
@AlCutter AlCutter marked this pull request as ready for review March 19, 2025 16:21
@AlCutter AlCutter requested a review from a team as a code owner March 19, 2025 16:21
@AlCutter AlCutter force-pushed the migration_follower_waiting branch 4 times, most recently from 467e97b to 5b914c1 Compare March 19, 2025 16:40
Comment thread migrate_lifecycle.go
o.followers = append(o.followers, func(ctx context.Context, lr LogReader) {
as.Populate(ctx, lr, o.bundleIDHasher)
})
o.followers = append(o.followers, as.Follower(o.bundleIDHasher))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you add a comment to bundleIDHasher that this must always be immutable after struct initialization? An easy trap now would be to add a feature to allow that to become mutable, which would make this WithAntispam method behave differently depending on order of calls.

@mhutchinson mhutchinson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Consider adding tests for this.

@AlCutter AlCutter force-pushed the migration_follower_waiting branch from 5b914c1 to 86f7e78 Compare March 20, 2025 15:10
@AlCutter AlCutter force-pushed the migration_follower_waiting branch from 03b5d5a to c3fa903 Compare March 20, 2025 15:12
@AlCutter

Copy link
Copy Markdown
Collaborator Author

Consider adding tests for this.

Yup, I'll come back with a follow-up PR so as not to block this one.

@AlCutter AlCutter merged commit 73534c5 into transparency-dev:main Mar 20, 2025
@AlCutter AlCutter deleted the migration_follower_waiting branch March 20, 2025 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants