remove "fix" for inspecting garbage keys

Inspect was changed to discard garbage keys.
Unfortunately, this change was incorrect, and users of inspect do not expect this.
This commit is contained in:
Nia Weiss 2020-10-07 12:14:44 -04:00
parent 33af6c1ac7
commit 195c6f7704
No known key found for this signature in database
GPG key ID: 895E83409BFDA1BB

View file

@ -584,11 +584,13 @@ func (h *GRPCHandler) Inspect(req *pb.InspectRequest, stream pb.Pilosa_InspectSe
//
// A query which will work here is 'SELECT *' or any query with more columns
// than just _id.
if colAdded > 0 {
if err := stream.Send(rowResp); err != nil {
return errors.Wrap(err, "sending response to stream")
}
//if colAdded > 0 {
// This has been reverted, as it violates the expectations of users of inspect.
// It is expected that inspect will return garbage.
if err := stream.Send(rowResp); err != nil {
return errors.Wrap(err, "sending response to stream")
}
//}
}
} else {
@ -607,7 +609,7 @@ func (h *GRPCHandler) Inspect(req *pb.InspectRequest, stream pb.Pilosa_InspectSe
}
}
forceSend := false
//forceSend := false
ci := []*pb.ColumnInfo{
{Name: "_id", Datatype: "string"},
}
@ -627,11 +629,11 @@ func (h *GRPCHandler) Inspect(req *pb.InspectRequest, stream pb.Pilosa_InspectSe
end = uint64(len(cols))
}
cols = cols[offset:end]
if len(cols) == 1 {
/*if len(cols) == 1 {
if id, err := h.api.TranslateIndexKey(stream.Context(), index.Name(), cols[0], false); id != 0 && err == nil {
forceSend = true
}
}
}*/
} else {
// Prevent getting too many records by forcing a limit.
pql := fmt.Sprintf("All(limit=%d, offset=%d)", limit, offset)
@ -909,11 +911,13 @@ func (h *GRPCHandler) Inspect(req *pb.InspectRequest, stream pb.Pilosa_InspectSe
// -------
// <nil>
// (1 row)
if colAdded > 0 || forceSend {
if err := stream.Send(rowResp); err != nil {
return errors.Wrap(err, "sending response to stream")
}
//if colAdded > 0 || forceSend {
// This has been reverted, as it violates the expectations of users of inspect.
// It is expected that inspect will return garbage.
if err := stream.Send(rowResp); err != nil {
return errors.Wrap(err, "sending response to stream")
}
//}
}
}