-
Notifications
You must be signed in to change notification settings - Fork 104
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
Error: 2 UNKNOWN: Transaction outcome unknown #202
Comments
FWIW this error occurs in the same location as we currently get a bunch of errors like so:
(although this is expected for the values reported later in the message, just thought it could be relevant) |
Another thing to note is that the requests which fail with this error all fail in just over 5 seconds. Could be a coincidence but they're all within |
Here is the code which is causing this error (but succeeds usually): // spanner is a Spanner database object ready to be used for operations
// tableName is a String of the desired table's name
// rowData is an object of data to write
export default (spanner, tableName, rowData) => {
return new Promise((resolve, reject) => {
// eslint-disable-next-line consistent-return
spanner.runTransaction((errTrx, dbTrx) => {
if (errTrx) {
honeyLogger.error('V3 encountered error inserting', errTrx);
return reject(errTrx);
}
const addedInfo = { storeShardId: getSpannerShardId(rowData.storeId) };
const insertColumns = Object.assign({}, addedInfo, rowData);
dbTrx.insert(tableName, insertColumns);
dbTrx.commit((err) => {
if (err) {
dbTrx.end();
return reject(err);
}
return resolve();
});
});
})
.then(() => rowData);
}; This code was written before we got further along with spanner so the approach is a bit odd but does work for nearly all inserts. |
Just noting this is on the radar. We are currently handling some of the other issues which were prioritized over this. |
This bug is being tracked in the backend, and in the interim the recommendation is to ignore the error "outcome unknown" and retry the request. |
@snehashah16 do you have a bug on another public issue tracker the customer can follow? If there is no action item for this library, I'd prefer to not track it here :) |
@snehashah16, just following up on this again, is there an ETA for a fix on the backend of this? Should we harden retry on the client anyway? |
@JustinBeckwith adding a link to the back end issue: https://issuetracker.google.com/issues/90028517 |
Just spoke with a member of the Spanner team and they advised modifying the client to handle this particular error by retrying. The backend will be updated as well but they still would like the client to understand how to retry these types of failures. |
Fix released in https://www.npmjs.com/package/@google-cloud/spanner/v/1.4.3 |
Still seeing this issue occasionally on |
@walshie4 Apologies. Thanks for reporting. Would you mind opening a new issue with the call stack? Also priority wise, is this more important than the other issues? |
@JustinBeckwith Sure thing. If the other issue you're referring to is issue #183, that is more important. |
Environment details
@google-cloud/spanner
version: v1.4.1Steps to reproduce
Not sure what causes this but these errors started trickling in this morning. There's been about ~75 throughout the course of the day. Mainly wondering what would cause this sort of error and how I can go about debugging it.
Error info:
The text was updated successfully, but these errors were encountered: