apache / apache/cassandra-gocql-driver
Exec() returning ErrNotFound
- Dominant language
- Go
- Stars
- 2.7k
- Forks
- 658
- PR merge metrics
- No merged PRs in 30d
Description
Opening this issue on behalf of a customer ([vijay.rahulsagar@aexp.com](mailto:vijay.rahulsagar@aexp.com)) - please reach out for further details.
### What version of Cassandra are you using?
DSE 6.8.23
### What version of Gocql are you using?
1.4.0
### What version of Go are you using?
N/A
### What did you do?
Executing insert statements like this:
```
query := r.db.Query(insertQuery)
r.log.Loggings([logger.Info](https://logger.info/), r.GetUUTID(), fmt.Errorf("%s insert gicc sequence query:[%s]", eventcodes.GeneralInfo, query.String()), r.GetRulzHeaders())
t := time.Now()
var buf *bytes.Buffer
var trace gocql.Tracer
if cfg.Toggle(enableTracer) {
trace, buf = r.QueryTrace()
query = query.Trace(trace)
}
err = query.Exec()
r.log.Loggings(logger.Debug, r.GetUUTID(), fmt.Errorf("%s query trace for inserts into gicc:[%s]", eventcodes.CassandraQuery, buf.String()), r.GetRulzHeaders())
if err != nil {
r.SetMetricsError(err, insertaction, terminalSeqTable)
r.log.Loggings(logger.Error, r.GetUUTID(), fmt.Errorf("%s : for gicc sequence :%v", eventcodes.CassandraWriteError, err), r.GetRulzHeaders())
//setting terminal_terminal_trouble_issue code to 005 in case of error while inserting-- for GICC spec
r.SetStringData(terminalTroubleIssueCode, databaseInsertError.String())
return fmt.Errorf("%s : for gicc sequence :%v", eventcodes.CassandraWriteError, err)
}
```
Note: `r.db` above represents a session object
### What did you expect to see?
Did not expect ErrNotFound from an Exec() call
### What did you see instead?
```
E3092: Unable to write data to cassandra : for gicc sequence :not found
```
..apparently caused by [ErrNotFound](https://github.com/gocql/gocql/blob/v1.4.0/session.go#L2212)
Contributor guide
Research direction
Start in session.go around line 2212, where the report says ErrNotFound originates, and trace the Exec path for the shown insert query. Reproduce the behavior against the stated DSE 6.8.23 setup if available; done means the cause and expected Exec error behavior are established and covered by an appropriate test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cassandra, go
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100