Closed GoogleCodeExporter closed 9 years ago
Your "bq show -j" is a correct way to check for this -- can you help me
understand why this doesn't end up letting you append loads? (If this strategy
works out, it might be simplified as "bq --nosync load" and "bq wait".)
Another thing you can do is generate your own job_id and use that: if your
job_id is the same for a retry, then the retry will know not to double-add the
data.
(See http://stackoverflow.com/questions/11017729/making-sure-data-is-loaded for
sounds like a similar situation.)
Now, all that said, I'll look at whether this is a case where the code could
have known to wait longer. The bq command could be more strict about waiting
until the job has either succeeded or failed, so you would never have to check.
The flip side is that to be really 100%, it would have to be willing to wait
for 24+ hours. I think people might find that surprising as the default
behavior, but will consider it.
Original comment by e...@google.com
on 19 Nov 2014 at 6:11
Thanks for your answer, and sorry for not discovering stackoverflow question.
Yes, I have changed to async load + regular status check and it seems to work
now.
What I expect from (probably misread) bq documentation and my previous command
line tools experience is:
1. "bq load" and "bq --nosync load; bq wait" is exactly the same thing. So, if
former does not work for me, later will not either.
2. Every synchronous command (like "bq load" without "nosync") makes its best
to wait for the operation to complete. Including making reasonable retries when
it fails to fetch some data due to temporary network/backend problems. (Yes, I
am ok with this kind tools working for 24+ hours).
3. When there are clearly distinguishable error classes (like "we know load
operation failed" and "we failed, know nothing about load operation") - it is
possible to get this information from command's exit code. And from its output
also.
Probably it worth either fixing the code or the documentation (by highlighting
the way it works now).
Original comment by victor.g...@gmail.com
on 20 Nov 2014 at 3:26
Oh, no problem, an issue report is a perfectly fine place to file this too.
Yep, everything you say looks valid to me. What I meant with doing the "bq
wait" yourself is that then you have control over a top-level retry loop. But
granted, it's not obvious why you *should* have to add your own retry handling
here. I'll see if I can catch what would be escaping here.
Original comment by e...@google.com
on 20 Nov 2014 at 6:31
Thank you for your patience. It was not retrying certain conditions that it
should. This issue should be fixed in the current version of bq from the Cloud
SDK.
Original comment by e...@google.com
on 27 Feb 2015 at 6:36
Original comment by e...@google.com
on 27 Feb 2015 at 6:37
Original issue reported on code.google.com by
victor.g...@gmail.com
on 29 Oct 2014 at 3:13