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

fix: do not roll back transaction on partial identity insert error #4211

Merged
merged 6 commits into from
Nov 14, 2024

Conversation

zepatrik
Copy link
Member

A follow up on #4083, where the basic feature was implemented but the transaction was eventually rolled back also it seemed like it succeeded.

@@ -637,7 +639,7 @@ func (p *IdentityPersister) CreateIdentities(ctx context.Context, identities ...
return sqlcon.HandleError(err)
}

return partialErr
Copy link
Member Author

Choose a reason for hiding this comment

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

This was the problem.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that rolling back the transaction is unwanted, but we do want to return information about which identity inserts failed. Don't we lose that information here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah sorry, I misread, looks good!

@@ -637,7 +639,7 @@ func (p *IdentityPersister) CreateIdentities(ctx context.Context, identities ...
return sqlcon.HandleError(err)
}

return partialErr
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that rolling back the transaction is unwanted, but we do want to return information about which identity inserts failed. Don't we lose that information here?

@zepatrik zepatrik changed the title fix: do not roll back transaction on partial insert error fix: do not roll back transaction on partial identity insert error Nov 14, 2024
@zepatrik zepatrik merged commit 82660f0 into master Nov 14, 2024
28 checks passed
@zepatrik zepatrik deleted the fix/batch-identity-insert-persists-on-failure branch November 14, 2024 15:29
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.

2 participants