agentm / project-m36

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

Server breaks with a DatabaseValidationError #298

Closed farzadbekran closed 2 years ago

farzadbekran commented 2 years ago

I have cloned and built the server from source (v 0.9.3). When I run a server, connect to it with tutd, make some changes, :commit and :quit, when running the server again I get a DatabaseValidationError:

Steps to reproduce:

in the source directory:

> stack --stack-yaml stack.ghc8.8.yaml exec -- project-m36-server -n test-db -d test-db --fsync

in a second terminal in the source directory:

> stack --stack-yaml stack.ghc8.8.yaml exec -- tutd -h 127.0.0.1 -n test-db
...
TutorialD (master/main): :branch test1
TutorialD (test1/main): a:=relation{i Int}
TutorialD (test1/main): :commit
TutorialD (test1/main): :quit
Goodbye.

once I :quit from tutd, the server exits with this error:

project-m36-server: Network.Socket.recvBuf: end of file (end of file)

after that when I try to run the server again I get this:

Failed to create database connection: DatabaseValidationError [MerkleValidationError 45320b53-4b5c-4db7-8ef7-45dff1ea969a (MerkleHash {_unMerkleHash = "\RS\248\246\230bZ\215{\166{\USV\243\228\150\233\230\146\229\131h\237\189\230p\214\220\253\159\EOT\247O"}) (MerkleHash {_unMerkleHash = "a\SUB\233-\188PL\SO\201\168\b\218\154U\228wy\234\145&\241\\\EMca\aD2\ETX\155D\237"}),MerkleValidationError eb0498b1-9756-4353-a3ed-68f21a862400 (MerkleHash {_unMerkleHash = ""}) (MerkleHash {_unMerkleHash = "\SO\194\161\DC3\205\&0\233g\208:D\233\235\155\232\205M./\220\228\225\226\SI\179\128K\141\136}\SO\215"})]

I'm not sure if I'm doing something wrong or this is just a bug.

agentm commented 2 years ago

Thanks for the report- I will try to reproduce this. As a workaround, does the docker image produce different results? On which operating system are you running this?

farzadbekran commented 2 years ago

Can't use Docker due to sanctions (I live in Iran), I'm Using Archlinux.

agentm commented 2 years ago

Thanks for the update- I'm able to reproduce this and should have a fix shortly.

agentm commented 2 years ago

Hi @farzadbekran , sorry I missed your message on IRC. I'm around today in case you are free to chat.

farzadbekran commented 2 years ago

Hi @agentm , I'll be there in a couple of hours. Let me gather my thoughts and questions. Kinda forgot what I was gonna ask XD