Commit a59d7830 authored by Libor Peltan's avatar Libor Peltan

journal: changeset merge: remove phase first

...to avoid TTL mismatches between added and removed rdata
parent 7f46eb40
......@@ -353,11 +353,11 @@ int changeset_remove_removal(changeset_t *ch, const knot_rrset_t *rrset)
int changeset_merge(changeset_t *ch1, const changeset_t *ch2)
{
changeset_iter_t itt;
changeset_iter_add(&itt, ch2);
changeset_iter_rem(&itt, ch2);
knot_rrset_t rrset = changeset_iter_next(&itt);
while (!knot_rrset_empty(&rrset)) {
int ret = changeset_add_addition(ch1, &rrset, CHANGESET_CHECK);
int ret = changeset_add_removal(ch1, &rrset, CHANGESET_CHECK);
if (ret != KNOT_EOK) {
changeset_iter_clear(&itt);
return ret;
......@@ -366,11 +366,11 @@ int changeset_merge(changeset_t *ch1, const changeset_t *ch2)
}
changeset_iter_clear(&itt);
changeset_iter_rem(&itt, ch2);
changeset_iter_add(&itt, ch2);
rrset = changeset_iter_next(&itt);
while (!knot_rrset_empty(&rrset)) {
int ret = changeset_add_removal(ch1, &rrset, CHANGESET_CHECK);
int ret = changeset_add_addition(ch1, &rrset, CHANGESET_CHECK);
if (ret != KNOT_EOK) {
changeset_iter_clear(&itt);
return ret;
......
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