Project

General

Profile

Actions

Feature #17698

closed

Parallelize writes inside keepstore when there are writes that request multiple storage classes.

Added by Peter Amstutz over 3 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Keep
Target version:
Story points:
-
Release relationship:
Auto

Description

Customer wants to have two storage classes by default, which means always writing to two locations, so keepstore should be able to write both of them at the same time instead of one after another.


Subtasks 1 (0 open1 closed)

Task #17933: Review 17698-keepstore-concurrent-writesResolvedLucas Di Pentima08/13/2021Actions

Related issues 1 (0 open1 closed)

Related to Arvados Epics - Idea #16107: Storage classesResolved03/01/202109/30/2021Actions
Actions #1

Updated by Peter Amstutz over 3 years ago

Actions #2

Updated by Peter Amstutz over 3 years ago

  • Target version set to 2021-08-04 sprint
  • Assigned To set to Tom Clegg
Actions #3

Updated by Peter Amstutz over 3 years ago

  • Description updated (diff)
Actions #4

Updated by Peter Amstutz over 3 years ago

  • Target version changed from 2021-08-04 sprint to 2021-08-18 sprint
Actions #5

Updated by Tom Clegg over 3 years ago

  • Status changed from New to In Progress

17698-keepstore-concurrent-writes @ e0632f47bb83bda5badccc47cc2d8dbb70d92678 -- developer-run-tests: #2639

This adds concurrency in cases where writing to multiple classes involves writing to multiple volumes.

The new test case confirms that we don't over-replicate by starting more writes when the writes already in flight (should they turn out to be successful) will suffice, but it doesn't actually confirm that any writes are done concurrently.

Actions #6

Updated by Peter Amstutz over 3 years ago

  • Target version changed from 2021-08-18 sprint to 2021-09-01 sprint
Actions #7

Updated by Lucas Di Pentima over 3 years ago

Some questions & comments:

  • At file services/keepstore/handlers.go
    • Line 858: PutBlock() documentation comments seem to be a bit stale.
    • Line 840: I think newPutResult() should be named newPutProgress() and var naming consistency be maintained, as it makes the code difficult to follow for me.
    • Line 929: I'm curious as to why the code block doesn't use the mnt var provided by the for-loop. Is that some special go-ism?
    • Line 930: pending.Add() is called without mtx protection, wouldn't that allow more than one goroutine to add the same mnt?
  • At file services/keepstore/volume.go
    • Line 404: Is len(vm.writables) always > 0? If not, I think we'll get a panic on read-only keepstores, correct? If yes, maybe it would be convenient to add some tests for NextWritable()
Actions #8

Updated by Tom Clegg over 3 years ago

Lucas Di Pentima wrote:

  • Line 858: PutBlock() documentation comments seem to be a bit stale.

Indeed. Updated.

  • Line 840: I think newPutResult() should be named newPutProgress() and var naming consistency be maintained, as it makes the code difficult to follow for me.

Fixed, thanks.

  • Line 929: I'm curious as to why the code block doesn't use the mnt var provided by the for-loop. Is that some special go-ism?

That ensures each goroutine gets its own mnt var indicating the mnt it's supposed to work on -- otherwise they would all share the for loop's var, changing underneath them.

  • Line 930: pending.Add() is called without mtx protection, wouldn't that allow more than one goroutine to add the same mnt?

mtx is locked there -- and for that whole loop, except while calling cond.Wait(). Added a comment to this effect.

  • At file services/keepstore/volume.go
    • Line 404: Is len(vm.writables) always > 0? If not, I think we'll get a panic on read-only keepstores, correct? If yes, maybe it would be convenient to add some tests for NextWritable()

Turns out handlePUT() doesn't even call PutBlock() if there are no writable volumes, but I added a test and fixed NextWritable anyway.

17698-keepstore-concurrent-writes @ 69cc7c89aa51e7aa7265215bfc910eaa457986d8 -- developer-run-tests: #2646

Actions #9

Updated by Lucas Di Pentima over 3 years ago

Thanks for the clarifications, this LGTM, thanks!

Actions #10

Updated by Tom Clegg over 3 years ago

  • Status changed from In Progress to Resolved
Actions #11

Updated by Peter Amstutz about 3 years ago

  • Release set to 42
Actions

Also available in: Atom PDF