Driver-Chunker protocol

From wiki.zmanda.com
Revision as of 17:57, 14 June 2010 by Dustin (talk | contribs) (in progress)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Communication method

Driver talks via two pipes connected to each chunker's stdin and stdout. The commands and responses are newline-terminated plain text lines.

Like the Driver-Taper protocol, this protocol is almost turn-based, although there are situations where either side may send a message.

Commands

START

Driver -> Chunker:

 START timestamp

Sets the chunker's timestamp. The Driver will next send either QUIT or PORT-WRITE.

QUIT

Driver -> Chunker:

 QUIT

PORT-WRITE

Driver -> Chunker

 PORT-WRITE handle filename host features disk level dumpdate chunksize progname use options

Start writing a dump to holding disk. The handle uniquely identifies this operation, but a given chunker only performs one operation at a time so this is not required. The combination of filename, chunksize, and use correspond to those described for CONTINUE.

The chunker will respond either with PORT or TRYAGAIN (if TRYAGAIN, then the chunker will exit immediately after transmission). If the creation of the first chunk file fails, it may also respond with NO-ROOM followed by TRYAGAIN and exit.

PORT

Chunker -> Driver

 PORT header-port ip-port-pairs

Indicates that the driver should cause a connection to header-port containing the header, followed by a connection to one of the ip-port-pairs containing the data. Note that the chunker will close the header connection before accepting the data connection. This is similar to the PORT command in the Driver-Taper protocol.

The chunker will block waiting for the incoming header connection, although if there is an error or timeout it will respond with TRYAGAIN and exit.

NO-ROOM

Chunker -> Driver

NO-ROOM handle

This is an informational message indicating that the chunker has actually run out of space while writing (e.g., encountered ENOSPC on a write() operation). The chunker will subsequently send RQ-MORE-DISK.

RQ-MORE-DISK

Chunker -> Driver

RQ-MORE-DISK handle

This indicates that the chunker needs further instruction on where it should write. The driver should reply with one of CONTINUE or ABORT.

DONE

PARTIAL

FAILED

BAD-COMMAND

BOGUS

TRYAGAIN

Chunker -> Driver

FAILED

ABORT

ABORT-FINISHED

CONTINUE