Skip to content

syz-cluster: refactor blob storage #6018

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

Closed
wants to merge 1 commit into from

Conversation

a-nogikh
Copy link
Collaborator

Split URI generation and write operation of the blob storage.

This allows to do quick "if URI does not exist, generate and save it" operation within DB transactions and do the actual write at a later point.

Since we don't use two-stage commits here, there's a risk of inconsistency between the blob storage and the DB, and we can only pick one that'd be more affected.

In the current scheme:

  1. For crash artifacts, we store artifacts before saving an entry to the
    DB, so we risk having garbage in the blob storage.
  2. For logs/debugging info, we first update the DB and then write the
    logs. We risk not serving the latest logs from the dashboard.

These choices can be changed any time.

Split URI generation and write operation of the blob storage.

This allows to do quick "if URI does not exist, generate and save it"
operation within DB transactions and do the actual write at a later
point.

Since we don't use two-stage commits here, there's a risk of
inconsistency between the blob storage and the DB, and we can only
pick one that'd be more affected.

In the current scheme:
1) For crash artifacts, we store artifacts before saving an entry to the
   DB, so we risk having garbage in the blob storage.
2) For logs/debugging info, we first update the DB and then write the
   logs. We risk not serving the latest logs from the dashboard.

These choices can be changed any time.
@a-nogikh a-nogikh requested a review from tarasmadan May 13, 2025 11:03
@@ -41,7 +41,10 @@ func (repo *SessionTestRepository) InsertOrUpdate(ctx context.Context, test *Ses
_, iterErr := iter.Next()
if iterErr == nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Reordering this if->else if->else you can merge 2 beforeSave calls and shift left some code

Copy link
Collaborator

@tarasmadan tarasmadan May 16, 2025

Choose a reason for hiding this comment

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

if iterErr != iterator.Done {
	return iterErr
}
if beforeSave != nil {
	err := beforeSave(test)
	if err != nil {
		return err
	}
}
...
if iterErr == nil {
	...
}

@a-nogikh
Copy link
Collaborator Author

Deprecated in favor of #6082

@a-nogikh a-nogikh closed this Jun 12, 2025
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