cover all concurrency + etag cases
@@ -199,8 +199,12 @@ func (r *StateStore) writeRow(req *state.SetRequest) error {
err := entity.Insert(storage.FullMetadata, nil)
if err != nil {
if etag == "" {
+ if req.Options.Concurrency == state.FirstWrite {
return state.NewETagError(state.ETagMismatch, err)
}
+
+ return entity.Update(true, nil)
+ }
err := entity.Update(false, nil)
if err != nil {
if isNotFoundError(err) {
