#include <errornum.h> #include <error.h> #define ES_JREP 13 #include "msgjrep.h" ErrorId MsgJrep::ShortUsage = { ErrorOf( ES_JREP, 1, E_FAILED, EV_USAGE, 0 ), "Usage: p4jrep [-J journal] [-j prefix] [-i instance] [-L logfile] [-d delay] [-t delay] [-a] [-k] command" } ; ErrorId MsgJrep::VVNotSeen = { ErrorOf( ES_JREP, 2, E_FAILED, EV_ADMIN, 0 ), "No complete @vv@ record near beginning of journal" } ; ErrorId MsgJrep::VVUnknownVersion = { ErrorOf( ES_JREP, 3, E_FAILED, EV_ADMIN, 1 ), "Unknown version \"%version%\" in @vv@ record" } ; ErrorId MsgJrep::VVFirstNotJournal = { ErrorOf( ES_JREP, 4, E_FAILED, EV_ADMIN, 0 ), "db.counters journal not found in @vv@ record" } ; ErrorId MsgJrep::VVInvalidFormat = { ErrorOf( ES_JREP, 5, E_FAILED, EV_ADMIN, 0 ), "Format of @vv@ record is invalid" } ; ErrorId MsgJrep::VVSscanfFail = { ErrorOf( ES_JREP, 6, E_FAILED, EV_ADMIN, 0 ), "sscanf failure while converting sequence in @vv@ record" } ; ErrorId MsgJrep::PosBadChars = { ErrorOf( ES_JREP, 7, E_FAILED, EV_ADMIN, 1 ), "Non-digit characters in position read from %file%" } ; ErrorId MsgJrep::PosSscanfFail = { ErrorOf( ES_JREP, 8, E_FAILED, EV_ADMIN, 1 ), "sscanf failure while converting position read from %file%" } ; ErrorId MsgJrep::NotRecreated = { ErrorOf( ES_JREP, 9, E_FAILED, EV_ADMIN, 1 ), "%file% not recreated" } ;
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#6 | 7886 | Michael Shields |
Correctly handle 2010.2 journals, which have an @nx@ record as the first record in the journal after the journal has been rotated. |
||
#5 | 6439 | Michael Shields |
Updating for the 2008.1 p4d. The format of the @vv@ record changed in the 2008.1 p4d. The @vv@ record is the one and only journal record the format of which is important to p4jrep. This p4jrep can also be used with prior releases of p4d. Version string: p4jrep Version 0.91 (beta) |
||
#4 | 6155 | Michael Shields |
Updated for the 2007.3 release while maintaining compatibility with prior releases. 2007.3 and later servers might rotate the journal by renaming it rather than copying and truncating it. A renamed journal is now detected by comparing the device and inode returned from statting by the journal's file name and statting by the journal's file descriptor. This algorithm (suggested by J.T. Goldstone; thanks J.T.!) is faster than reopening the journal and seeking if the journal was not rotated (~2.0 seconds vs. ~2.7 seconds for 1,000,000 iterations on my laptop). |
||
#3 | 5119 | Michael Shields |
Added -t delay in an attempt to ensure transactional atomicity. If no additional journal entries are written during this delay, the transaction is assumed complete, which closes the pipe, which terminates the command (which if includes a p4d -jr, releases the locks in the target server, allowing commands access to the replicated atomic transaction). By default, this delay is ten milliseconds. Locking the journal does not ensure transactional atomicity since the server locks the journal once for each journal entry written, not once per transaction. And we would like to avoid locking the journal since that would introduce a potential concurrency problem. Not all operations in the server are atomic transactions and therefore cannot be replicated atomically. For example, updating a client's have list as files are being synced is not an atomic transaction. But committing a submit is an atomic transaction, and this change (with perhaps some site-specific tuning of the -t delay) attempts to replicate the commit atomically. |
||
#2 | 5012 | Michael Shields |
Added [-d <delay>] option to delay (in seconds) between checks for new entries in the live journal. By default, the delay between checks is one second. |
||
#1 | 4839 | Michael Shields | Pushing p4jrep source into the public depot. |