Skip to content

Commit

Permalink
[BUG] - Revert "[ENH] Enabling Soft-delete." #3164 (#3196)
Browse files Browse the repository at this point in the history
## Description of changes

*Summarize the changes made by this PR.*
 - New functionality
   - Reverts #3164 - Soft Delete.

## Test plan
*How are these changes tested?*

- [ ] Tests pass locally with `pytest` for python, `yarn test` for js,
`cargo test` for rust

## Documentation Changes
*Are all docstrings for user-facing APIs updated if required? Do we need
to make documentation changes in the [docs
repository](https://github.com/chroma-core/docs)?*
n/a
  • Loading branch information
rohitcpbot authored Nov 26, 2024
1 parent baa5abd commit f36c386
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
2 changes: 1 addition & 1 deletion go/cmd/coordinator/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func init() {
Cmd.Flags().StringVar(&conf.DBConfig.SslMode, "ssl-mode", "disable", "SSL mode for database connection")

// Soft deletes
Cmd.Flags().BoolVar(&conf.SoftDeleteEnabled, "soft-delete-enabled", true, "Enable soft deletes")
Cmd.Flags().BoolVar(&conf.SoftDeleteEnabled, "soft-delete-enabled", false, "Enable soft deletes")
Cmd.Flags().DurationVar(&conf.SoftDeleteCleanupInterval, "soft-delete-cleanup-interval", 1*time.Minute, "Soft delete cleanup interval")
Cmd.Flags().DurationVar(&conf.SoftDeleteMaxAge, "soft-delete-max-age", 72*time.Hour, "Soft delete max age")
Cmd.Flags().UintVar(&conf.SoftDeleteCleanupBatchSize, "soft-delete-cleanup-batch-size", 10, "Soft delete cleanup batch size")
Expand Down
15 changes: 0 additions & 15 deletions go/pkg/sysdb/grpc/segment_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ func (s *Server) CreateSegment(ctx context.Context, req *coordinatorpb.CreateSeg
}

func (s *Server) GetSegments(ctx context.Context, req *coordinatorpb.GetSegmentsRequest) (*coordinatorpb.GetSegmentsResponse, error) {
log.Info("GetSegments", zap.String("request", req.String()))
segmentID := req.Id
segmentType := req.Type
scope := req.Scope
Expand All @@ -61,20 +60,6 @@ func (s *Server) GetSegments(ctx context.Context, req *coordinatorpb.GetSegments
scopeString := scope.String()
scopeValue = &scopeString
}

// If Collection has been deleted (soft or hard), then do not return the segments.
collection, err := s.coordinator.GetCollections(ctx, parsedCollectionID, nil, "", "", nil, nil)
if err != nil {
log.Error("GetSegments failed. GetCollections error", zap.Error(err), zap.String("request", req.String()))
return res, grpcutils.BuildInternalGrpcError(err.Error())
}
if len(collection) == 0 {
log.Info("GetSegments - Collection not found. Returning empty response", zap.String("request", req.String()))
return res, nil
}

log.Info("GetSegments. Collection found", zap.Any("collection", collection[0]))
// Get segments for the collection.
segments, err := s.coordinator.GetSegments(ctx, parsedSegmentID, segmentType, scopeValue, parsedCollectionID)
if err != nil {
log.Error("GetSegments failed.", zap.Error(err), zap.String("request", req.String()))
Expand Down

0 comments on commit f36c386

Please sign in to comment.