So far, we have described how to perform eager-writing-based scheduling on a single disk. The scheduling on an EW-Array is more complex because a read request can be serviced by any one of the disks that has a replica and a write request can return as soon as the first one or two copies are made persistent. We now incorporate the single-disk eager-writing algorithms described in the previous sections into the mirror scheduling algorithm employed by Yu et al [30].
A read request is sent to the idle disk head that is closest to a replica if at least one of the disks that contain the data is idle. If all the disks that contain the desired data are busy, a duplicate request is inserted into each of the relevant drive queues. Each disk employs an eager-writing scheduling algorithm as described in the previous sections. As soon as one of the duplicates completes, all remaining duplicate requests are canceled.
A write request can be sent to any one of the disks that are supposed to contain a replica. If any of these disks are idle, it is sent to the one that is closest to a free block. If all disks that should contain the desired data are busy, the request is inserted into the shortest queue. A second foreground write can be similarly scheduled for increased reliability. We set aside the remaining replica writes (if any) in a separate delayed write queue associated with each drive. Replica propagations from the delayed write queues are scheduled only when the foreground queues are empty.