Skip to content

Commit

Permalink
Set transaction isolation to strict serializable
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbyiliev committed Sep 27, 2024
1 parent 1109885 commit 02c1e01
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ services:
- --system-parameter-default=max_clusters=100
- --system-parameter-default=max_sources=100
- --system-parameter-default=max_aws_privatelink_connections=10
- --system-parameter-default=transaction_isolation=serializable
- --all-features
environment:
MZ_NO_TELEMETRY: 1
Expand Down
6 changes: 6 additions & 0 deletions pkg/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, version stri
log.Printf("[ERROR] Error initializing DB client for region %s: %v\n", provider.ID, diags)
continue
}
// Explicitly set the transaction isolation level to 'strict serializable' for each region
_, err = dbClient.Exec("SET TRANSACTION_ISOLATION TO 'STRICT SERIALIZABLE''")
if err != nil {
log.Printf("[ERROR] Failed to set transaction isolation level for region %s: %v\n", provider.ID, err)
continue
}

dbClients[clients.Region(provider.ID)] = dbClient
}
Expand Down

0 comments on commit 02c1e01

Please sign in to comment.