One implementation detail that make the cluster work is it's queue. File operations are often not done in real time but are defered and queued for later processing. This text explains the basics behind the queue.

The cluster queues

The reason for queuing is simple. Consider you want to delete a file on you server. The file is stored on two nodes, one of them is up and running but the second is down. If the cluster server would try to delete the files on you nodes in real time it would come back with either leaving the second copy on the yet unavailable node with submitting the deletition to a queue for later processing when the node is up again.

Obviously the second variant is preferable since it can deal with broken nodes and in an environment where we have a lot of node server we have to accept that a node might be out of service. So we end up with a queue anyway.

The cluster extends the idea of the queue in so far that the server doesn't even attempt to delete files on the nodes on real time. It submits the whole job immediatly to the queue.

Queue formats

First of all the queue is made up from the files in the .queue directory. Well, not all files. Queuefiles must match a naming convention to be recognized, see below.

Second, the queue stores entries for file uploads, file storage, replication and deletition. Each job description has a slightly different format. The common thing among these different sub-queues is that (1) each queue job is one line in a queue file and (2) queue job's type is determined by a keyword.

The DELE queue

In addition to the queues above there is also another "helper" queue. If a file is deleted via FTP it's info/link file is only moved into the .deleted directory. A later run of the remove program deletes the files from the cluster node or, if this is not possible, resubmits the files back into the queue using the .queue directory this time.

Notice that the DELE queue might be discontinued in a future release by submitting deleted files directly to the remove queue.

Queue filenames

Ok, now we know about the different queue types and their formats. But what are queue files and where are they stored? The answer is simple: all files in the .queue directory with the .q extension are considered as queue files containing entries for one or more queue types of the above.

But furthermore (due to the way queueing was implemented) each of the queue processors store, replicate and remove accepts files that meet another naming convention.

store
reads files beginning with store- or uploads-.

replicate
reads files beginning with either replicate- or replicator-.

remove
reads file starting with remove-.
Usually you don't have to care about these naming convention.