Commit 2192fc5f authored by Daniel Salzman's avatar Daniel Salzman

zone-update: don't create journal upon full commit if journal disabled or not present

fixes #635
parent 59ffc112
......@@ -650,9 +650,10 @@ static int commit_full(conf_t *conf, zone_update_t *update)
/* Store new zone contents in journal. */
conf_val_t val = conf_zone_get(conf, C_JOURNAL_CONTENT, update->zone->name);
if (conf_opt(&val) == JOURNAL_CONTENT_ALL) {
unsigned content = conf_opt(&val);
if (content == JOURNAL_CONTENT_ALL) {
ret = zone_in_journal_store(conf, update->zone, update->new_cont);
} else { // zone_in_journal_store does this automatically
} else if (content != JOURNAL_CONTENT_NONE) { // zone_in_journal_store does this automatically
ret = zone_changes_clear(conf, update->zone);
}
......
......@@ -303,9 +303,13 @@ int zone_changes_clear(conf_t *conf, zone_t *zone)
JOURNAL_LOCK_RW
int ret = open_journal(zone);
if (ret == KNOT_EOK) {
ret = journal_drop_changesets(zone->journal);
int ret = KNOT_EOK;
if (journal_exists(zone->journal_db, zone->name)) {
ret = open_journal(zone);
if (ret == KNOT_EOK) {
ret = journal_drop_changesets(zone->journal);
}
}
JOURNAL_UNLOCK_RW
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment