Skip to content

Commit 68a2147

Browse files
committed
small fixes
1 parent 1029890 commit 68a2147

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

app/vlselect/internalselect/internalselect.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,12 +424,15 @@ func writeValuesWithHits(w http.ResponseWriter, qctx *logstorage.QueryContext, v
424424
return nil
425425
}
426426

427-
func writeTenantIDs(w http.ResponseWriter, tenantIDs []byte, disableCompression bool) error {
427+
func writeTenantIDs(w http.ResponseWriter, tenantIDs []logstorage.TenantID, disableCompression bool) error {
428+
// Marshal tenantIDs at first
429+
var b []byte
430+
logstorage.MarshalTenantIDs(b, tenantIDs)
428431
if !disableCompression {
429-
tenantIDs = zstd.CompressLevel(nil, tenantIDs, 1)
432+
b = zstd.CompressLevel(nil, b, 1)
430433
}
431434
w.Header().Set("Content-Type", "application/json")
432-
if _, err := w.Write(tenantIDs); err != nil {
435+
if _, err := w.Write(b); err != nil {
433436
return fmt.Errorf("cannot send response to the client: %w", err)
434437
}
435438
return nil

app/vlselect/logsql/logsql.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package logsql
22

33
import (
44
"context"
5-
"encoding/json"
65
"flag"
76
"fmt"
87
"io"

app/vlstorage/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package vlstorage
22

33
import (
4+
"context"
45
"encoding/json"
56
"flag"
67
"fmt"

app/vlstorage/netselect/netselect.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ func (sn *storageNode) getTenantIDs(ctx context.Context, start, end int64) ([]by
236236
args.Set("start", fmt.Sprintf("%d", start))
237237
args.Set("end", fmt.Sprintf("%d", end))
238238
args.Set("disable_compression", fmt.Sprintf("%v", sn.s.disableCompression))
239-
return sn.executeRequestAt(ctx, "/internal/select/tenant_ids", args)
239+
return sn.getResponseForPathAndArgs(ctx, "/internal/select/tenant_ids", args)
240240
}
241241

242242
func (sn *storageNode) getCommonArgs(version string, qctx *logstorage.QueryContext) url.Values {
@@ -476,7 +476,7 @@ func (s *Storage) getTenantIDs(ctx context.Context, start, end int64) ([]logstor
476476
}(i)
477477
}
478478
wg.Wait()
479-
if err := getFirstNonCancelError(errs); err != nil {
479+
if err := getFirstError(errs, false); err != nil {
480480
return nil, err
481481
}
482482

0 commit comments

Comments
 (0)