Skip to content

Commit

Permalink
fix problems
Browse files Browse the repository at this point in the history
  • Loading branch information
gregjhogan committed Sep 28, 2023
1 parent 06e6371 commit dcb4e17
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:]
Expand Down
4 changes: 2 additions & 2 deletions src/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit dcb4e17

Please sign in to comment.