You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Kim van der Riet (JIRA)" <ji...@apache.org> on 2014/01/15 23:12:19 UTC

[jira] [Resolved] (QPID-5483) [linearstore] Recovery of journal with partly written record fails with "JERR_JREC_BADRECTAIL: Invalid data record tail" error message

     [ https://issues.apache.org/jira/browse/QPID-5483?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kim van der Riet resolved QPID-5483.
------------------------------------

    Resolution: Fixed

Fixed in svn r.1558589.

The store now correctly handles the above-described reproducer and correctly discards the bad record and writes filler records to the next softblock boundary.

> [linearstore] Recovery of journal with partly written record fails with "JERR_JREC_BADRECTAIL: Invalid data record tail" error message
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: QPID-5483
>                 URL: https://issues.apache.org/jira/browse/QPID-5483
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>            Reporter: Kim van der Riet
>            Assignee: Kim van der Riet
>
> When recovering a store journal which contains a partly written record (such that the header is present, but the tail record is not), the broker terminates with the message
> {color:blue}{{critical Unexpected error: Queue tq1: recoverMessages() failed: jexception 0x0701 enq_rec::decode() threw JERR_JREC_BADRECTAIL: Invalid data record tail. (Magic: expected 0x9aacb3ae; found 0x0)}}{color}
> Expected behavior: The broker should handle such recoveries by treating the partly written record as invalid and, if necessary, adding filler records so that the next write can take place on an softblock boundary.
> To reproduce:
> 1. Start the broker:
> {color:blue}{{./qpidd --load-module linearstore.so -m no --auth no --default-flow-stop-threshold 0 --default-flow-resume-threshold 0 --default-queue-limit 0 --store-dir /home/kpvdr/RedHat --log-enable info+ --truncate yes}}{color}
> 2. Run a client to create some records in a queue:
> {color:blue}{{./qpid-send -a "tq1;{create:always,node:{type:queue,durable:true} }" --durable true --tx 0 --content-size 1000 --messages 100}}{color}
> 3. Use a hex editor (eg hexedit) to partly overwrite the last record from the middle of the data section (containing the 'X' characters through to the end of the last write (where all the '\0' characters start) so that the record header and part of the data is still present, but the tail end of the data and record tail (and any filler records) are overwritten.
> 4. Restart the broker to recover the store:
> {color:blue}{{./qpidd --load-module linearstore.so -m no --auth no --default-flow-stop-threshold 0 --default-flow-resume-threshold 0 --default-queue-limit 0 --store-dir /home/kpvdr/RedHat --log-enable info+ --truncate no}}{color}
> The broker first detects the bad alignment:
> {color:blue}
> {{2014-01-15 16:38:45 \[Store\] warning Linear Store: Journal "tq1": Bad record alignment found at fid=0x1 offs=0x139800 (likely journal overwrite boundary); 16 filler record(s) required.}}
> {{2014-01-15 16:38:45 \[Store\] notice Linear Store: Journal "tq1": Recover phase write: Wrote filler record: fid=0x1 offs=0x139800}}
> {{...}}
> {color}
> but terminates with the error message at the top of this description.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org