attic-labs / noms

The versioned, forkable, syncable database
Apache License 2.0
7.44k stars 266 forks source link

NBS: Serialize Commit() calls within a process #3594

Closed cmasone-attic closed 7 years ago

cmasone-attic commented 7 years ago

This patch uses process-wide per-store locking to ensure that only one NomsBlockStore instance is ever trying to update the upstream NBS manifest at a time. It also locks out attempts to fetch the manifest contents during that window.

Conjoining is now much simpler. Since only one instance can ever be in the critical path of Commit at a time, and conjoining is triggered on that critical path, we now simply perform the conjoin while excluding all other in-process NBS instances. Hopefully, locking out instances who want to fetch the manifest contents during a conjoin won't cripple performance.

Fixes issue #3583

cmasone-attic commented 7 years ago

OK, PTAL. Sorry this didn't get out this AM