3.3.4.4.7 COMM_COMMAND Is CMD_SEND_STAGE

The downstream partner is requesting the local staging file. The upstream partner MUST send the local staging file to the requesting downstream partner.

The server MUST validate the following:

  • P_IN.COMM_CXTION MUST exist.

  • CO_IN.ChangeOrderGuid MUST be a GUID.

  • P_IN.COMM_CXTION MUST be an outbound connection that has joined with the downstream partner.

If one of the above tests fails, the server MUST NOT reply to this call. If all of the above tests pass, the server MUST send CMD_RECEIVING_STAGE packet to the downstream partner:

COMM_COMMAND: MUST be 0x238 (CMD_RECEIVING_STAGE).

COMM_JOIN_GUID: MUST be P_IN.COMM_JOIN_GUID.

COMM_LAST_JOIN_TIME: MUST be P_IN.COMM_LAST_JOIN_TIME.

COMM_BLOCK:

Stage Header: MUST be attached if COMM_FILE_OFFSET in this packet is 0. Set the fields in the stage header as follows:

  • Major MUST be set to 0.

  • Minor SHOULD be set to 3. 0, 1, and 2 SHOULD NOT be used (see section 2.2.3.10).

  • DataHigh MUST be set to 0.

  • DataLow MUST be set to 0x400.

  • Compression MUST be set to 0.

  • A structure of type FILE_NETWORK_OPEN_INFORMATION that describes the file or folder. For the definition of this structure, see [MS-FSCC] section 2.4.27.

  • ChangeOrderCommand MUST be copied from the CMD_SEND_STAGE, except for the following fields:

    • Flags MUST bitwise OR CO_FLAG_LOCALCO if the change order originates locally on the upstream partner.

    • State:

    • PartnerAckSeqNumber MUST be set to the sequence number received from the upstream partner in CMD_REMOTE_CO.

    • COMM_REMOTE_CO.FileUsn MUST be ignored.

    • COMM_REMOTE_CO.OldParentGuid MUST be set to the local replica tree root GUID if the parent is the replica tree root; otherwise, keep the original value from the CMD_REMOTE_CO packet received.

    • COMM_REMOTE_CO.NewParentGuid MUST be set to the local replica tree root GUID if the parent is the replica tree root; otherwise, keep the original value from the CMD_REMOTE_CO packet received.

    • AckVersion MUST be set to the version vector number received from the upstream partner in CMD_REMOTE_CO.

  • CocExt MUST be set to 0 if the downstream partner's FRS Minor version is NTFRS_COMM_MINOR_4 or above. If the downstream partner has a FRS Minor version below NTFRS_COMM_MINOR_4, the structure MUST hold data as specified in section 2.2.3.6.21. <86>

  • The Microsoft backup format data for the staging file being transmitted, as specified in [MS-BKUP]. The data can be compressed.

COMM_BLOCK_SIZE: MUST be the size of COMM_BLOCK.Length (see section 2.2.3.6.13).

COMM_FILE_SIZE: MUST be the total size of the staging data and the staging header.

COMM_FILE_OFFSET: MUST be the P_IN.COMM_FILE_OFFSET.

COMM_CO_GUID: MUST be set to CO_IN.ChangeOrderGuid.

COMM_CO_SEQUENCE_NUMBER: MUST be 0.

See sections 4.2, 4.4.6, 4.5.1.2, 4.5.1.4, 4.5.2.2, 4.5.4.2, and 4.5.6.2 for examples of the use of this command.

The downstream partner will receive the CMD_ABORT_FETCH (see section 3.3.4.4.10) or CMD_RETRY_FETCH (see section 3.3.4.4.11) packet if the upstream partner is unable to handle the CMD_SEND_STAGE packet for any of the following reasons.

When the upstream partner receives the CMD_SEND_STAGE request then the out connection MUST be in JOINED state. If the connection is not in JOINED state then server MUST send CMD_RETRY_FETCH back to downstream partner. The downstream partner MUST perform the initial sync and then send a CMD_SEND_STAGE to the upstream partner.

If the upstream partner is unable to access the staging file due to ERROR_SHARING_VIOLATION then the upstream partner MUST send a CMD_RETRY_FETCH back to the downstream partner.

If the staging file is missing then the upstream partner MUST try to generate the missing staging file. If the upstream partner is unable to create a missing staging file with ERROR_DISK_FULL then the upstream partner MUST send CMD_RETRY_FETCH to the downstream partner.  ERROR_DISK_FULL is also generated when the staging quota is reached for the replica set; the error goes away when staging quota is increased manually or staging cleanup is done by the upstream partner. If the upstream partner fails to create the staging file because of any other failure (such as an ACCESS_DENIED error) then the upstream partner MUST send a CMD_ABORT_FETCH to the downstream partner.

If the upstream partner is unable to fetch the staging file because it has already been deleted then the upstream partner MUST send a CMD_RETRY_FETCH to the downstream partner, which will cause the file to be recreated on the next CMD_SEND_STAGE request from the downstream partner.

If the upstream partner is unable to read the file due to file corruption then the upstream partner MUST delete the corrupted file and send CMD_RETRY_FETCH to the downstream partner, which will cause the file to be recreated on the next CMD_SEND_STAGE request from the downstream partner.