Derecho-Project / derecho

The main code repository for the Derecho project.
BSD 3-Clause "New" or "Revised" License
182 stars 46 forks source link

Make Persist return a version #244

Closed etremel closed 1 year ago

etremel commented 1 year ago

Although the implementations of the Persistent::persist() method (in e.g. FilePersistLog) have always returned the version actually persisted, which is sometimes greater than the requested version, the top-level persist method and the PersistentRegistry version did not. This turned out to be a problem for my signatures code, since it meant versions could get persisted without being signed if they were persisted "automatically" within FilePersistLog::persist(). Weijia added logic to return the version actually persisted from Persistent and PersistentRegistry, and I fixed the loop in Replicated to repeat the sign() method if more versions were persisted than initially expected.