services/mounttable/btmtd: Fix bug with concurrent createChild

When createChild() is called concurrently, it is possible to leave an
incorrect reference in the parent, e.g.

createChild1 --> insert child with ts1 in parent
 createChild2 --> insert child with ts2 in parent

createChild1 --> Create child row with ts1
 createChild2 --> Create child row wth ts2 (Fails, already exists)

OR,

createChild1 --> insert child with ts1 in parent
 createChild2 --> insert child with ts2 in parent

 createChild2 --> Create child row wth ts2
createChild1 --> Create child row with ts1 (Fails, already exists)

When createChild1 or createChild2 fails, the reference in the parent
for ts1 or ts2 was left behind. The fix is to delete that reference when
the row creation fails.

https://github.com/vanadium/build/issues/88

Change-Id: I9947ef2459550636ce0bc7ec3f8c1766f789bbec
1 file changed
tree: 58888be00ebc7840ace82f2a6c1bdb6ff9007d5e
  1. cmd/
  2. examples/
  3. internal/
  4. lib/
  5. runtime/
  6. services/
  7. test/
  8. .gitignore
  9. AUTHORS
  10. CONTRIBUTING.md
  11. CONTRIBUTORS
  12. envvar.go
  13. envvar_test.go
  14. LICENSE
  15. PATENTS
  16. README.md
  17. VERSION
README.md

Vanadium

This repository contains a reference implementation of the Vanadium APIs.

Unlike the APIs in https://github.com/vanadium/go.v23, which promises to provide backward compatibility this repository makes no such promises.