mapleFU commented on code in PR #2508:
URL: https://github.com/apache/kvrocks/pull/2508#discussion_r1741465465
##########
src/search/hnsw_indexer.cc:
##########
@@ -75,11 +80,16 @@ void HnswNode::DecodeNeighbours(engine::Context& ctx, const
SearchKey& search_ke
Status HnswNode::AddNeighbour(engine::Context& ctx, const NodeKey&
neighbour_key, const SearchKey& search_key,
rocksdb::WriteBatchBase* batch) const {
auto edge_index_key = search_key.ConstructHnswEdge(level, key,
neighbour_key);
- batch->Put(ctx.storage->GetCFHandle(ColumnFamilyID::Search), edge_index_key,
Slice());
-
+ auto rocket_s = batch->Put(ctx.storage->GetCFHandle(ColumnFamilyID::Search),
edge_index_key, Slice());
+ if (!rocket_s.ok()) {
+ return {Status::NotOK, rocket_s.ToString()};
+ }
HnswNodeFieldMetadata node_metadata = GET_OR_RET(DecodeMetadata(ctx,
search_key));
node_metadata.num_neighbours++;
- PutMetadata(&node_metadata, search_key, ctx.storage, batch);
+ auto s = PutMetadata(&node_metadata, search_key, ctx.storage, batch);
+ if (!s.IsOK()) {
+ return s;
+ }
return Status::OK();
Review Comment:
```suggestion
return PutMetadata(&node_metadata, search_key, ctx.storage, batch);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]