diff --git a/src/lib.go b/src/lib.go index 5feac8d..da6896c 100644 --- a/src/lib.go +++ b/src/lib.go @@ -37,7 +37,7 @@ func toRecord(data []byte) Record { rec.deleted = NO if strings.HasPrefix(ss, "INIT") { rec.deleted = INIT - ss = ss[3:] + ss = ss[4:] } else if strings.HasPrefix(ss, "DELETED") { rec.deleted = SOFT ss = ss[7:] diff --git a/src/server.go b/src/server.go index 0434c14..cb33569 100644 --- a/src/server.go +++ b/src/server.go @@ -163,8 +163,8 @@ func (a *App) WriteToReplicas(key []byte, value io.Reader, valuelen int64) int { if remote_put(remote, valuelen, body) != nil { // we assume the remote wrote nothing if it failed fmt.Printf("replica %d write failed: %s\n", i, remote) - // try not to leave key in INIT (writing) state - a.PutRecord(key, Record{kvolumes, SOFT, hash}) + // try not to leave key in INIT (writing) state (ignore errors) + a.PutRecord(key, Record{kvolumes, SOFT, ""}) return 500 } }