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

[no-release-notes] go: sqle: DatabaseProvider: Fix double-creation of push-on-write commit hooks in registerNewDatabase. #8830

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

reltuk
Copy link
Contributor

@reltuk reltuk commented Feb 6, 2025

No description provided.

… push-on-write commit hooks in registerNewDatabase.
@reltuk reltuk requested a review from zachmu February 6, 2025 22:56

func (ddb *DoltDB) PrependCommitHook(ctx context.Context, hook CommitHook) *DoltDB {
ddb.db = ddb.db.SetCommitHooks(ctx, append([]CommitHook{hook}, ddb.db.PostCommitHooks()...))
func (ddb *DoltDB) PrependCommitHooks(ctx context.Context, hooks ...CommitHook) *DoltDB {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

SetCommitHooks was destructive and potentially dangerous. For now, it seems easier to make hook writers coordinate on these things upstream.

return err
}
dbs, err := ApplyReplicationConfig(ctx, sql.NewBackgroundThreads(), mrEnv, cli.CliErr, db)
sdb, err := applyReadReplicationConfigToDatabase(ctx, newEnv, db)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ApplyReplicationConfig creates the commit hooks and is responsible for the transform of the dsess.SqlDatabase into a ReadOnlyDatabase if it needs to be configured as such. Here, we just need the later functionality: the other functionality is already handled (and more) by our InitDatabaseHook.

@coffeegoddd
Copy link
Contributor

@reltuk DOLT

comparing_percentages
100.000000 to 100.000000
version result total
5a6caad ok 5937457
version total_tests
5a6caad 5937457
correctness_percentage
100.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants