agentm / project-m36

Project: M36 Relational Algebra Engine
The Unlicense
895 stars 48 forks source link

RelError (NoSuchAttributeNamesError (fromList ["attrname"]) #154

Open 3noch opened 7 years ago

3noch commented 7 years ago

I'm using the latest changes with compression. I imported a CSV backup into the database (which worked!). I committed and my webserver reported that it didn't know about the records I had added. I thought maybe it needed to start a new session so I restarted the server so it would reconnect to the database. Now I get the error in the subject. The migration transaction apparently finishes fine. It errors out when I try to query the database.

3noch commented 7 years ago

Could it be that tutd corrupted the database somehow?

3noch commented 7 years ago

I should note that tutd never had any issues after the import + commit. Only my webserver had issues. But if I delete the db and let the webserver create it (with migrations), it works fine. I can observe that the webserver did set up the scheme correctly (by querying with tutd).

3noch commented 7 years ago

Opening tutd and running :showexpr relvar where attrname="test" gives no error.

3noch commented 7 years ago

As far as I can tell if the webserver is the only thing inserting into the database, things work.

agentm commented 7 years ago

Is the error in the title anonymized? "attrname" doesn't appear anywhere in the code.

I tried to reproduce a similar situation with the websocket client and tutd together but I didn't encounter unexpected behavior.

When two clients share the same database directory, unlike postgresql, for example, there is no read-committed mode, so the trailing client will need to issue a commit or rollback to see the updated transaction graph. Is that the issue you are seeing?

One alternative to address stale state is to use the asynchronous notification callback system which triggers when user-selected state is changed. The client can then decide what action to take.

agentm commented 7 years ago

It might help to compare what each client thinks the current transaction graph appears to be by using :showgraph.

agentm commented 7 years ago

@3noch suggested that it could be useful to refresh the transaction graph from disk on initiating a new session. I could investigate the feasibility of that.