-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate tables and databases #15
Comments
Hmmm... I mean, every time you call Can you post most details about this? Maybe post the results of running If this is actually a problem that's somehow caused by |
I thought so. But here it is. So assuming that I may not know something, I decided to first start an issue here, and then maybe go to rethinkdb issues. Yes, my environment consists of at least three nodes, each connected through its own
IMHO, this looks better from the engineering perspective. ;) |
Can you post the results of
The problem with that is the following, if it was able to create the database twice, who says it's going to know about that database in the first place? Would would |
I'm going to try to reproduce this and see if I can get it to happen too. More question for trying to reproduce this:
Anything else that could help in reproducing this? |
Sorry, the last time it happened I fixed it as soon as I found the problem (with renaming and then deleting clones from RDB web-console). Because it prevents new nodes to work properly - RethinkDB driver would not connect displaying messages like
|
Yeah, I understand. |
Ok, a couple of more questions:
I think this might be enough to at least try to replicate it. |
Oh. Hope it's possible to understand all this. :) But I guess that all this things with ssh-tunnels and local-node-remote-rdb are not important, because if I understand correctly, this happened a few times when no one was using this. So, there were two nodes using one shared database through their own |
Hey @lolwhoami, @tjmehta was able to repro this and get these two guys, so this is definitely a thing. Seems to be a RethinkDB error for sure though (TJ doesn't use this module), but I'd be interesting to get a good way to repro and see if anything can be done about it. |
Well, if I understand correctly, this happens when rethinkdb proxy is started and node is connected, but the proxy is not yet fully connected to the server, so it doesn't know that some tables or databases exist. |
Just to let you know and maybe close the issue. I've been running some tests with creation of dbs and tables through rethinkdb-proxy and found out that checking for So, looks like the only solution here is to use some separate file or db to store information about actual db structure, just as they stated in the issue you've mentioned. But it's so weird! Oh... |
I've built my own version of rethinkdb-init with db state saved in json file. |
Hey, I've created my own handler for initiating new databases similar to this project for an application i'm working on. Unfortunately there isn't much of a way against the race conditions but I did write this little gem which disgustingly solves the problem: _RemoveRethinkCollisions() {
this._Database.RethinkDB.db('rethinkdb').table('current_issues').filter({
type: 'table_name_collision'
}).run().then(Issues => {
if (!Issues.length)
return Logger.Info('No issues found');
const TablesToRemove = Issues.map(Issue => Issue.info.ids.slice(1)).reduce((Array, Tables) => Array.concat(Tables), []);
this._Database.RethinkDB.db('rethinkdb').table('table_config').getAll(...TablesToRemove).delete().run().then(_ => {
console.log(_);
})
})
} This might not be appropriate to your use case and this issue is over 7 months old but I wanted to provide some insight in case it is helpful. Cheers. |
Sometimes something strange happens and I find that there are duplicate tables or even databases exist in our RethinkDB server.
For some reason I think this could happen when connection to RDB is interrupted due to RDB restart or some other reason. May your module try to create a database or a table in this situation?
The text was updated successfully, but these errors were encountered: