|
|
Flavio Junqueira 2012-10-08, 19:54
I was wondering if there is any mechanism implemented to detect WALEdits that haven't been entirely written to the wal. Say that a transaction (using the terminology in the header of the WALEdit class) has three edits, but only two get written to the wal. How do we detect that it is a corrupt record when reading?
Thanks! -Flavio
-
Re: Question about WALEdit
Ted Yu 2012-10-08, 21:10
>From javadoc:
* In the new world, all the edits for a given transaction are written * out as a single record, for example: * * <logseq#-for-entire-txn>:<WALEdit-for-entire-txn>
The keyvalues for the three edits would be stored in one record.
public void readFields(DataInput in) throws IOException {
If only two got written, the above method would throw IOException.
Cheers
On Mon, Oct 8, 2012 at 12:54 PM, Flavio Junqueira <[EMAIL PROTECTED]> wrote:
> I was wondering if there is any mechanism implemented to detect WALEdits > that haven't been entirely written to the wal. Say that a transaction > (using the terminology in the header of the WALEdit class) has three edits, > but only two get written to the wal. How do we detect that it is a corrupt > record when reading? > > Thanks! > -Flavio
-
Re: Question about WALEdit
Flavio Junqueira 2012-10-08, 21:34
Thanks, Ted. It detects it by writing and reading back the number of elements. Does it detect if the last one has been partially written?
-Flavio
On Oct 8, 2012, at 11:10 PM, Ted Yu wrote:
> From javadoc: > > * In the new world, all the edits for a given transaction are written > * out as a single record, for example: > * > * <logseq#-for-entire-txn>:<WALEdit-for-entire-txn> > > The keyvalues for the three edits would be stored in one record. > > public void readFields(DataInput in) throws IOException { > > If only two got written, the above method would throw IOException. > > Cheers > > On Mon, Oct 8, 2012 at 12:54 PM, Flavio Junqueira <[EMAIL PROTECTED]> wrote: > >> I was wondering if there is any mechanism implemented to detect WALEdits >> that haven't been entirely written to the wal. Say that a transaction >> (using the terminology in the header of the WALEdit class) has three edits, >> but only two get written to the wal. How do we detect that it is a corrupt >> record when reading? >> >> Thanks! >> -Flavio
-
Re: Question about WALEdit
Ted Yu 2012-10-08, 21:39
I would expect IOException to be thrown if the last one was partially written.
Cheers
On Mon, Oct 8, 2012 at 2:34 PM, Flavio Junqueira <[EMAIL PROTECTED]> wrote:
> Thanks, Ted. It detects it by writing and reading back the number of > elements. Does it detect if the last one has been partially written? > > -Flavio > > On Oct 8, 2012, at 11:10 PM, Ted Yu wrote: > > > From javadoc: > > > > * In the new world, all the edits for a given transaction are written > > * out as a single record, for example: > > * > > * <logseq#-for-entire-txn>:<WALEdit-for-entire-txn> > > > > The keyvalues for the three edits would be stored in one record. > > > > public void readFields(DataInput in) throws IOException { > > > > If only two got written, the above method would throw IOException. > > > > Cheers > > > > On Mon, Oct 8, 2012 at 12:54 PM, Flavio Junqueira <[EMAIL PROTECTED]> > wrote: > > > >> I was wondering if there is any mechanism implemented to detect WALEdits > >> that haven't been entirely written to the wal. Say that a transaction > >> (using the terminology in the header of the WALEdit class) has three > edits, > >> but only two get written to the wal. How do we detect that it is a > corrupt > >> record when reading? > >> > >> Thanks! > >> -Flavio > >
|
|