Skip to content

Commit

Permalink
processRepo callback needs deltastore bs for gap fill (#323)
Browse files Browse the repository at this point in the history
Im not confident this is right yet, but giving it a try to see if it
fixes our issues
  • Loading branch information
whyrusleeping authored Sep 19, 2023
2 parents 5726fa8 + 2081afe commit 664c6ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion cmd/bigsky/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ func Bigsky(cctx *cli.Context) error {
// https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace#readme-environment-variables
// At a minimum, you need to set
// OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
if os.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT") != "" {
if ep := os.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT"); ep != "" {
log.Infow("setting up trace exporter", "endpoint", ep)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand Down Expand Up @@ -208,12 +209,14 @@ func Bigsky(cctx *cli.Context) error {
return err
}

log.Infow("setting up main database")
dburl := cctx.String("db-url")
db, err := cliutil.SetupDatabase(dburl, cctx.Int("max-metadb-connections"))
if err != nil {
return err
}

log.Infow("setting up carstore database")
csdburl := cctx.String("carstore-db-url")
csdb, err := cliutil.SetupDatabase(csdburl, cctx.Int("max-carstore-connections"))
if err != nil {
Expand Down Expand Up @@ -255,6 +258,7 @@ func Bigsky(cctx *cli.Context) error {
var persister events.EventPersistence

if dpd := cctx.String("disk-persister-dir"); dpd != "" {
log.Infow("setting up disk persister")
dp, err := events.NewDiskPersistence(dpd, "", db, events.DefaultDiskPersistOptions())
if err != nil {
return fmt.Errorf("setting up disk persister: %w", err)
Expand Down Expand Up @@ -317,6 +321,7 @@ func Bigsky(cctx *cli.Context) error {
}
}

log.Infow("constructing bgs")
bgs, err := bgs.NewBGS(db, ix, repoman, evtman, cachedidr, blobstore, hr, !cctx.Bool("crawl-insecure-ws"))
if err != nil {
return err
Expand All @@ -342,6 +347,7 @@ func Bigsky(cctx *cli.Context) error {
bgsErr <- err
}()

log.Infow("startup complete")
select {
case <-signals:
log.Info("received shutdown signal")
Expand Down
2 changes: 1 addition & 1 deletion repomgr/repomgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ func (rm *RepoManager) processNewRepo(ctx context.Context, user models.Uid, r io
return ds.CloseWithRoot(ctx, root, nrev)
}

if err := cb(ctx, root, finish, membs); err != nil {
if err := cb(ctx, root, finish, ds); err != nil {
return fmt.Errorf("cb errored root: %s, rev: %s: %w", root, *rev, err)
}

Expand Down

0 comments on commit 664c6ea

Please sign in to comment.