Browse Source

weed filer: mysql/postgres use ReadCommitted transaction isolation level for atomic rename

pull/914/head
Chris Lu 6 years ago
parent
commit
b4c276263f
  1. 5
      weed/filer2/abstract_sql/abstract_sql_store.go

5
weed/filer2/abstract_sql/abstract_sql_store.go

@ -26,7 +26,10 @@ type TxOrDB interface {
} }
func (store *AbstractSqlStore) BeginTransaction(ctx context.Context) (context.Context, error) { func (store *AbstractSqlStore) BeginTransaction(ctx context.Context) (context.Context, error) {
tx, err := store.DB.BeginTx(ctx, nil)
tx, err := store.DB.BeginTx(ctx, &sql.TxOptions{
Isolation: sql.LevelReadCommitted,
ReadOnly: false,
})
if err != nil { if err != nil {
return ctx, err return ctx, err
} }

Loading…
Cancel
Save