Commit 1a400d07 authored by gerd's avatar gerd

Adding RPC program Namesync

git-svn-id: 55289a75-7b90-4627-9e07-ffb4263930b2
parent 3ce3009c
......@@ -52,6 +52,7 @@ X = $(IPC)/pfs_types.x \
$(IPC)/pfs_nn_coord.x \
$(IPC)/pfs_nn_dnadmin.x \
$(IPC)/pfs_nn_internal.x \
$(IPC)/pfs_nn_namesync.x \
$(IPC)/pfs_nfs3.x \
$(IPC)/pfs_datanode.x \
$(IPC)/pfs_dn_internal.x \
......@@ -63,6 +64,7 @@ X_TXT = ipc/pfs_types.txt \
ipc/pfs_nn_coord.txt \
ipc/pfs_nn_dnadmin.txt \
ipc/pfs_nn_internal.txt \
ipc/pfs_nn_namesync.txt \
ipc/pfs_nfs3.txt \
ipc/pfs_datanode.txt \
ipc/pfs_dn_internal.txt \
/* $Id$ -*- c -*- */
/** {1:namesync [Namesync]} */
/** This RPC program is used to synchronize several namenodes
by exchanging checkpoints and log files. It is running on the
coordinator only.
#include "pfs_types.x"
program Namesync {
version V1 {
/** {2 [null] } */
void null(void) = 0;
/** {2:create_checkpoint [create_checkpoint] } */
rdump create_checkpoint(void) = 10;
/** Triggers the creation of a new checkpoint. This procedure
does not wait until the checkpoint is done, but returns
as soon as the name of the dump is known.
- [ECONFLICT]: another checkpoint is still being created
- [EPERM]: checkpointing is currently blocked
/** {2:get_checkpointing_status [get_checkpointing_status] } */
errno_code get_checkpointing_status(dump) = 11;
/** Retrieve the success status of an ongoing checkpoint creation.
- [OK]: the checkpoint exists
- [ETBUSY]: the creation is not yet finished
- [ENOENT]: no such dump at all
- [ESTALE]: there are no transaction data for this dump (i.e.
it is an old checkpoint)
/** {2:block_checkpointing [block_checkpointing] } */
hyper block_checkpointing(hyper) = 12;
/** Requests to block checkpointing until the specified time
(in seconds since the epoch). The function returns the
confirmed time until which checkpointing is blocked, which
may be lower than the request.
Blocking new checkpoints is useful when a resync is in
progress in order to prevent that the current checkpoint
/** {2:create_log_dump [create_log_dump] } */
rdump create_log_dump(dump, hyper) = 20;
/** [create_log_dump(checkpoint, min_id)]: Creates a new log
dump for this checkpoint with all log entries >= [min_id].
This procedure
does not wait until the checkpoint is done, but returns
as soon as the name of the dump is known.
- [ESTALE]: The passed checkpoint is not the current checkpoint
/** {2:get_log_dumping_status [get_log_dumping_status] } */
errno_code get_log_dumping_status(dump) = 21;
/** Retrieve the success status of an ongoing dumping operation.
- [OK]: the dump exists
- [ETBUSY]: the dump is not yet finished
- [ENOENT]: no such dump at all
- [ESTALE]: there are no transaction data for this dump (i.e.
it is an old dump)
/** {2:list_dumps [list_dumps] } */
dumps list_dumps(dump) = 30;
/** Lists available and finished dumps matching the pattern passed
as parameter. If a non-empty string is passed as [dump_prefix],
[dump_ref] or [dump_suffix] only dumps are returned with the
same property. An empty string does not restrict the property.
A negative [dump_ts] means to only return dumps older than
[-dump_ts]. A positive [dump_ts] means to only return dumps
newer than [dump_ts]. A zero [dump_ts] does not restrict the
/** {2:list_dump_files [list_dump_files] } */
dumpfiles list_dump_files(dump) = 31;
/** Return the dump files for a single dump. Empty on error. */
/** {2:read_dump_file [read_dump_file] } */
rlongstring read_dump_file(dump, longstring, hyper, int) = 32;
/** [read_dump_file(dump, dump_file, pos, len)]: reads a
portion of a dump file, and returns the data as string.
If the file has at least the length [pos+len] the returned
string has exactly the length [len]. If the file is shorter,
the string covers only the existing part of the file. If
[pos] points to a file position beyond the end of the file,
the returned string is empty.
bool attach1(longstring, longstring) = 40;
/** [attach1(clustername,hostport)]: Prepares the reattachment
of a dead namenode to an existing cluster at the end of the
synchronization. [hostport] must be the host and port of
the caller, i.e. the namenode to attach.
This function blocks any new commits in the coordinator
(until [attach2] or until the TCP connection breaks).
Also, it is waited until the commits being done are finished.
Basically, all writing filesystem procedures are halted.
The caller has now the chance to get and apply the last
log dump to get synchronized with the coordinator database.
Returns [true] on success.
bool attach2(longstring, longstring, longstring, longstring) = 41;
/** [attach1(clustername,hostport,max_revid,cksum_revids)]:
Reattaches the caller as namenode slave to the coordinator.
This unblocks pending commits again, and the filesystem is
again fully functional.
The slave [hostport] is re-enabled, and will now get
db updates (with the {!Pfs_nn_internal.nameslave} program).
[max_revid] and [cksum_revids] are as for [Elect.set_coordinator].
} = 1;
} = 0x8000e006;
......@@ -10,3 +10,5 @@
#include "pfs_nn_dnadmin.x"
#include "pfs_nn_internal.x"
#include "pfs_nn_auth.x"
#include "pfs_nn_namesync.x"
......@@ -329,6 +329,26 @@ struct fsstat {
mediumstrings dead_datanodes;
/** {2 [dump] and [dumpfile]} */
struct dump {
longstring dump_prefix;
longstring dump_ref;
longstring dump_suffix;
hyper dump_ts;
typedef dump dumps<>;
struct dumpfile {
longstring dumpfile_name;
hyper dumpfile_size;
typedef dumpfile dumpfiles<>;
/** {2:errno_code [errno_code]} */
enum errno_code {
......@@ -387,7 +407,7 @@ enum errno_code {
- [rlongstring]
- [rlongstrings]
- [rentries]
- [rdump]
......@@ -400,7 +420,7 @@ MK_RESULT_TYPE(rhypers,hypers t);
MK_RESULT_TYPE(rlongstring,longstring t);
MK_RESULT_TYPE(rlongstrings,longstrings t);
MK_RESULT_TYPE(rentries,entries t);
MK_RESULT_TYPE(rdump,dump t);
/** {2 [ds_info]} */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment