Details
-
Bug
-
Resolution: Fixed
-
Major
-
7.6.0
-
Untriaged
-
0
-
Unknown
-
KV 2023-4
Description
MagmaKVStore::getMulti uses Magma::GetDocs to answer GET queries:
It uses magmaErr2EnginerErr for error handling. Current implementation is:
cb::engine_errc MagmaKVStore::magmaErr2EngineErr(Status::Code err, bool found) {
|
if (!found) { |
return cb::engine_errc::no_such_key; |
}
|
// This routine is intended to mimic couchErr2EngineErr. |
// Since magma doesn't have a memory allocation error, all magma errors |
// get translated into cb::engine_errc::temporary_failure. |
if (err == Status::Code::Ok) { |
return cb::engine_errc::success; |
}
|
return cb::engine_errc::temporary_failure; |
}
|
It always returns no_such_key when found=false. But found will always be false in presence of errors. We shouldn't return no_such_key in all such cases. That would be alarming and falsely indicate data loss.
The error handling needs to be granular wrt to the Status::Code. For example a IOError is temporary and hence we should return temporary_failure.