aquadoggo icon indicating copy to clipboard operation
aquadoggo copied to clipboard

Replication fails when receiving logs out of order

Open cafca opened this issue 2 years ago • 5 comments

Internally, replication uses the storage provider publish_entry method, which checks that logs are published in order. When replicating, logs may be received out of order so a different pathway for storing entries and operations received through replication would solve this.

ERROR aquadoggo::replication::service] Error inserting new entry into db: InvalidLogId(1, 0)

(also this log line should read "Error inserting new entry into db: Requested log id 1 does not match expected log id 0")

cafca avatar Jul 17 '22 22:07 cafca

Is this about logs or entries in order?

adzialocha avatar Jul 18 '22 06:07 adzialocha

The node refuses to replicate an entry for log 1 because it didn't receive anything for log 0 before that. I first thought huh, that must be trivial, just implement publish_entry as part of the replication and leave out all of those validations but then it wasn't trivial so I made this issue :D

cafca avatar Jul 18 '22 10:07 cafca

The node refuses to replicate an entry for log 1 because it didn't receive anything for log 0 before that. I first thought huh, that must be trivial, just implement publish_entry as part of the replication and leave out all of those validations but then it wasn't trivial so I made this issue :D

This sounds like similar to a discussion I had with @sandreae in Berlin. The thing is basically: The validation process for the Client API is different from the Node API, we have different guarantees there.

adzialocha avatar Jul 18 '22 10:07 adzialocha

Yeh, we need something new for this, publish_replicated (or some other amazing name) which will be build from the new validation methods.

sandreae avatar Jul 18 '22 15:07 sandreae

Currently I would even say that this is a feature and not a bug 🤣 logs should be received only in order. We would need to discuss this though on spec level ofc.

adzialocha avatar Sep 03 '22 09:09 adzialocha