-
Notifications
You must be signed in to change notification settings - Fork 591
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
Bigtable - issue with table.exists when creating a table then adding a family #1451
Comments
If I use the get methods with the autoCreate flag set to true I see the same issue var table = bigtable.table('prezzy');
table.get({autoCreate: true}, function(err, table, apiResponse) {
if (err) {
console.log("Error from table.get: " + err);
} else {
var family = table.family('follows');
console.log("Table Got/Created Ok");
family.get({autoCreate: true}, function(err, family, apiResponse) {
if (err) {
console.log("Error from family.get: " + err);
} else {
console.log("Family Got/Created Ok");
}
});
}
}); |
@dom-white thanks for opening this issue, I was able to produce this locally using your provided steps! Interestingly enough if I use a @lesv Any idea why this might be happening? |
projects/{12345678}/instances//clusters/my-cluster/tables/prezzy That doesn't look right. |
Sorry, I should have made it clear. I had redacted my project id for the post |
@lesv Is that because of the missing instance parameter? We haven't moved to Bigtable v2 yet, so I'm a little confused as to why it's even there. I'm also curious about why a race condition could be occurring when making a |
I'm curious why it's both there and empty. If your not on v2, it shouldn't be there at all. That might be why things are broken. |
@lesv here's some info about the API call that we make:
proto definition filemethod call
payload{
name: 'projects/nth-circlet-705/zones/us-central1-b/clusters/gcloud-node/tables/prezzy',
columnFamilyId: 'follows'
} response message
It seems like we're calling the v1 endpoint, but it's expecting information in a v2 format. |
I've asked Eng to comment -- will let you know when they respond. That actually makes some sense. |
Engineering thinks you might have found a caching bug:
As an immediate work-around, you should be able to provide the column families to create in the CreateTable call and skip the separate CreateColumnFamily call entirely. Alternatively, the cache expiration on point 1 is 5-10 seconds, so as long as there are at least 5-11 seconds between points 2 and 3 it should work OK. They are working on a more permanent solution - No ETA of a fix is available. |
that's great news, thanks! |
ok, just to be clear the caching bug still exists, so you have implemented the workaround regarding creating the family in the same call as the table is created. Yes? |
@dom-white correct - you can now specify all the column families up front when creating the table. |
ok, I have tested my scenario where I am unsure whether the table or the family is created yet and I have got it to work successfully with the updated createTable API. Here's my updated test code
Thanks again, |
Source-Link: googleapis/synthtool@cd78529 Post-Processor: gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:ddb19a6df6c1fa081bc99fb29658f306dd64668bc26f75d1353b28296f3a78e6
Hi, it's great to see the new Bigtable functionality added, but I am having an issue checking and creating tables.
I can successfully use table.create() and then call table.createFamily() from it's callback function, but I get an error on creation of the 'family' if I have just happened to test whether the table exists first.
Environment details
Steps to reproduce
In this case I get
If I simply remove the 'exists' test it works (obviously if the table does not exist. I am deleting the table between the tests)
This code produces the expected result
It would seem that the use of the 'exists' API call is changing the nature of the 'table' object
The text was updated successfully, but these errors were encountered: