Well, our metalogs are not really transaction logs (especially range
server meta logs) as they persist permanent states as well. Using the
terminology actually confuses the exact purpose of metalog. However
the approach/concept is very appropriate when we prepare both commit
log and meta log for general application level transactions. I think
we should design a more general purpose transaction log, when we
actually start to work on a distributed transaction server.
Some comments inline:
On Apr 6, 9:54 am, Doug Judd <
nuggetwh...@gmail.com> wrote:
> Taking it a step further, we could add ACTIONS into the log for
> capturing the state changes. For example:
>
> BEGIN
> ACTION start-split
> ACTION split-point-chosen( <split-point> )
> ACTION split-log-installed ( <split-log> )
> SAVE
> ACTION split-shrunk
> ACTION range-created
> SAVE
> COMMIT
For real transaction log, you'll need a unique transaction id for each
transaction and have all the action save points associated with it.
Otherwise, you cannot interleave transaction which is a severe
restriction. For this particular application (range split), what's the
advantage of this format over the current:
split-start(range, split-point, split-log)
split-shrunk(range)
split-done(range)
Which supports interleave splits for different range as well. The
overhead to support general transaction (atomically generated uuid
etc.) doesn't seem to worth it for now.
>
> Also, the API should allow you to write multiple entries in a single
> call. So in the above example, there would be just the three
>
> following MetaLog writes:
>
> BEGIN
> ACTION start-split
> ACTION split-point-chosen( <split-point> )
> ACTION split-log-installed ( <split-log> )
> SAVE
>
> followed by ...
>
> ACTION split-shrunk
> ACTION range-created
> SAVE
>
> followed by ...
>
> COMMIT
Again, this is conceptually fine but doesn't work as a real log format
as it doesn't support interleaving transactions.
> The RangeStateInfo could be modified slightly to hold the RangeSpec
> and a vector of log entries that represents all of the log entries for
> any outstanding uncommitted transactions. For example,
>
> class RangeStateInfo {
> RangeSpec range;
> vector<LogEntry> transaction_state;
>
> };
>
> If all transactions on the Range have committed, then the
> transaction_state vector would be empty.
Well, this is the pretty much the same API we agreed upon last week
though:
struct RangeStateInfo {
RangeSpec range;
vector<MetaLogEntryPtr> log_entries; // could be renamed to
txn_state to reflect the semantics described (empty when commited)
}
Since MetaLogEntry is an abstract interface with no app specific
logic, it could be extended to support transactions when we have a
MetaLogTxnEntry implementation in the future.
__Luke