Skip to content

Commit

Permalink
Merge pull request #6210 from chu11/issue6207_double_submit
Browse files Browse the repository at this point in the history
kvs: correct code logic about what is an append
  • Loading branch information
mergify[bot] authored Aug 10, 2024
2 parents c9296ea + bcb01f2 commit 7d18dd7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/modules/kvs/kvstxn.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,10 @@ static int kvstxn_append (kvstxn_t *kt, json_t *dirent,
/* entry not found, treat like normal insertion */
if (treeobj_insert_entry (dir, final_name, dirent) < 0)
return -1;
/* N.B. although this is an "insert", we still treat this as
* an "append". If we don't, the "append" could be issued
* twice, leading to duplicated data. See issue #6207. */
(*append) = true;
}
else if (treeobj_is_valref (entry)) {
char ref[BLOBREF_MAX_STRING_SIZE];
Expand Down

0 comments on commit 7d18dd7

Please sign in to comment.