Changeset e944e6d871dcff933a8da92b6efd7834bce03e59
- Timestamp:
- 11/24/09 21:34:45
(4 years ago)
- Author:
- Theo Schlossnagle <jesus@omniti.com>
- git-committer:
- Theo Schlossnagle <jesus@omniti.com> 1259098485 +0000
- git-parent:
[53aeed588114b6e346057869dab719cefe3000c9]
- git-author:
- Theo Schlossnagle <jesus@omniti.com> 1259098485 +0000
- Message:
attempt jlog repairs inline
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r53aeed5 |
re944e6d |
|
| 37 | 37 | #include "utils/noit_log.h" |
|---|
| 38 | 38 | #include "jlog/jlog.h" |
|---|
| | 39 | #include "jlog/jlog_private.h" |
|---|
| 39 | 40 | #include "noit_jlog_listener.h" |
|---|
| 40 | 41 | |
|---|
| … | … | |
| 153 | 154 | jlog_get_checkpoint(jcl->jlog, ac->remote_cn, &jcl->chkpt); |
|---|
| 154 | 155 | jcl->count = jlog_ctx_read_interval(jcl->jlog, &jcl->start, &jcl->finish); |
|---|
| | 156 | if(jcl->count < 0) { |
|---|
| | 157 | char idxfile[PATH_MAX]; |
|---|
| | 158 | noitL(noit_error, "jlog_ctx_read_interval: %s\n", |
|---|
| | 159 | jlog_ctx_err_string(jcl->jlog)); |
|---|
| | 160 | switch (jlog_ctx_err(jcl->jlog)) { |
|---|
| | 161 | case JLOG_ERR_FILE_CORRUPT: |
|---|
| | 162 | case JLOG_ERR_IDX_CORRUPT: |
|---|
| | 163 | jlog_repair_datafile(jcl->jlog, jcl->start.log); |
|---|
| | 164 | jlog_repair_datafile(jcl->jlog, jcl->start.log + 1); |
|---|
| | 165 | noitL(noit_error, |
|---|
| | 166 | "jlog reconstructed, deleting corresponding index.\n"); |
|---|
| | 167 | STRSETDATAFILE(jcl->jlog, idxfile, jcl->start.log); |
|---|
| | 168 | strlcat(idxfile, INDEX_EXT, sizeof(idxfile)); |
|---|
| | 169 | unlink(idxfile); |
|---|
| | 170 | STRSETDATAFILE(jcl->jlog, idxfile, jcl->start.log + 1); |
|---|
| | 171 | strlcat(idxfile, INDEX_EXT, sizeof(idxfile)); |
|---|
| | 172 | unlink(idxfile); |
|---|
| | 173 | goto alldone; |
|---|
| | 174 | break; |
|---|
| | 175 | default: |
|---|
| | 176 | goto alldone; |
|---|
| | 177 | } |
|---|
| | 178 | } |
|---|
| 155 | 179 | if(jcl->count > MAX_ROWS_AT_ONCE) { |
|---|
| 156 | 180 | /* Artificially set down the range to make the batches a bit easier |
|---|