grantcarthew / node-rethinkdb-job-queue

A persistent job or task queue backed by RethinkDB.
https://github.com/grantcarthew/node-rethinkdb-job-queue/wiki
MIT License
157 stars 16 forks source link

Add queue version to backing table #78

Open TomKaltz opened 7 years ago

TomKaltz commented 7 years ago

So I was testing reanimating and then canceling a terminated job. I reanimated a job, it gets updated correctly and goes to waiting status. Then if I try to cancel the job the update query blows up because it doesn't have the processCount field on the row.

Error: RethinkDB returned an error at getResultError

first_error: 'No attribute `processCount` in object...

This table might be from an older version of RJQ. Is this a bug or should I try this on a fresher queue table?

grantcarthew commented 7 years ago

What's the version of the package Tom? I haven't done any work in that area of the product for a long time so it is probably a bug.

Can you please get a copy of the jobs properties and values at the different stages?

Thanks mate.

TomKaltz commented 7 years ago

I must have been using a data table written by a version from last year. I've updated RJQ, cleared the table and added new jobs and cannot reproduce the problem.

grantcarthew commented 7 years ago

Oh, that's good. I had not thought about table versions though. There should be a version written to the table so upgrades can take place. The state document seems like a good choice for that.

TomKaltz commented 7 years ago

A DB upgrade/migration mechanism would be a killer feature. Perhaps just give warning on mismatched table versions for now?