Skip to content

Commit 7d18dd7

Browse files
authored
Merge pull request #6210 from chu11/issue6207_double_submit
kvs: correct code logic about what is an append
2 parents c9296ea + bcb01f2 commit 7d18dd7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/modules/kvs/kvstxn.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,10 @@ static int kvstxn_append (kvstxn_t *kt, json_t *dirent,
495495
/* entry not found, treat like normal insertion */
496496
if (treeobj_insert_entry (dir, final_name, dirent) < 0)
497497
return -1;
498+
/* N.B. although this is an "insert", we still treat this as
499+
* an "append". If we don't, the "append" could be issued
500+
* twice, leading to duplicated data. See issue #6207. */
501+
(*append) = true;
498502
}
499503
else if (treeobj_is_valref (entry)) {
500504
char ref[BLOBREF_MAX_STRING_SIZE];

0 commit comments

Comments
 (0)