Browse Source

ckdb - ignore non-processed workmarkers when determining the reload point

master
kanoi 9 years ago
parent
commit
d383285b3d
  1. 2
      src/ckdb.h
  2. 21
      src/ckdb_dbio.c

2
src/ckdb.h

@ -55,7 +55,7 @@
#define DB_VLOCK "1" #define DB_VLOCK "1"
#define DB_VERSION "1.0.3" #define DB_VERSION "1.0.3"
#define CKDB_VERSION DB_VERSION"-1.321" #define CKDB_VERSION DB_VERSION"-1.322"
#define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL " - from %s %s() line %d"
#define WHERE_FFL_HERE __FILE__, __func__, __LINE__ #define WHERE_FFL_HERE __FILE__, __func__, __LINE__

21
src/ckdb_dbio.c

@ -6872,13 +6872,30 @@ bool workmarkers_fill(PGconn *conn)
} }
row->pps_value = workinfo_pps(wi_item, row->workinfoidend, false); row->pps_value = workinfo_pps(wi_item, row->workinfoidend, false);
if (dbstatus.newest_workmarker_workinfoid < row->workinfoidend) { if (CURRENT(&(row->expirydate)) &&
!WMPROCESSED(row->status)) {
LOGWARNING("%s(): WARNING workmarkerid %"PRId64" (%s)"
" wid end %"PRId64" isn't processed! (%s) "
"You should abort ckdb and mark it if it "
"actually has already been processed",
__func__, row->markerid, row->description,
row->workinfoidend, row->status);
}
/* Ignore any workmarker that isn't processed, so that the
* necessary data to process it can be reloaded, if the
* workmarker is after the last processed shift
* Any CURRENT non-processed workmarkers will give a console
* warning (above) */
if (CURRENT(&(row->expirydate)) &&
WMPROCESSED(row->status) &&
dbstatus.newest_workmarker_workinfoid < row->workinfoidend) {
dbstatus.newest_workmarker_workinfoid = row->workinfoidend; dbstatus.newest_workmarker_workinfoid = row->workinfoidend;
if (!wi_item) { if (!wi_item) {
LOGEMERG("%s(): FAILURE workmarkerid %"PRId64 LOGEMERG("%s(): FAILURE workmarkerid %"PRId64
" wid end %"PRId64" doesn't exist! " " wid end %"PRId64" doesn't exist! "
"You should abort ckdb and fix it, " "You should abort ckdb and fix it, "
" since the reload may skip some data", "since the reload may skip some data",
__func__, row->markerid, __func__, row->markerid,
row->workinfoidend); row->workinfoidend);
} else { } else {

Loading…
Cancel
Save