Driver-Chunker protocol

From wiki.zmanda.com
Revision as of 19:32, 14 June 2010 by Dustin (talk | contribs) (more, but not done yet)
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. Once the data starts flowing, it may send NO-ROOM, RQ-MORE-DISK, or a completion status (DONE, PARTIAL, FAILED).

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.

CONTINUE

Driver -> Chunker

CONTINUE handle filename chunksize use

This instructs the chunker to continue writing up to use kb of data at filename using chunk size chunksize. The chunker goes back to work and may send another NO-ROOM, RQ-MORE-DISK, or a completion status (DONE, PARTIAL, FAILED)

ABORT

Driver -> Chunker

ABORT message

The chunker should abort the current run with the given message. Chunker should reply with an ABORT-FINISHED message.

ABORT-FINISHED

Chunker -> Driver

ABORT-FINISHED handle

Indicates that the abort operation is complete. The chunker will then send a status (FAILED) and exit.

DONE

PARTIAL

FAILED

BAD-COMMAND

BOGUS

TRYAGAIN

Chunker -> Driver