agentm / project-m36

Project: M36 Relational Algebra Engine
The Unlicense
876 stars 47 forks source link

Can't restart server after loading precompiled functions #312

Closed farzadbekran closed 2 years ago

farzadbekran commented 2 years ago

After successfully loading and using precompiled functions, if I close the server and start it again, I get this error:

expected precompiled atom function: checkEitherConstraint
CallStack (from HasCallStack):
  error, called at ./src/lib/ProjectM36/Transaction/Persist.hs:127:17 in project-m36-0.9.3-3iyufOLUmZH9Huwdv521QW:ProjectM36.Transaction.Persist
agentm commented 2 years ago

Oh, I can see how that would happen. After the server is restarted, it does not reload functions from modules.

We do not record the fact that we loaded functions from a separate object file, so we should create such a log to replay it later. That could introduce problems, for example, if the server's directory is moved, so perhaps we should copy the object file into the server directory for loading on restart. There may be some nuances here, but that seems to be what is missing.