Skip to content

Commit 19382ef

Browse files
authored
hotfix: remove external id check for now, it's too expensive (hatchet-dev#4048)
1 parent 8744c65 commit 19382ef

2 files changed

Lines changed: 37 additions & 34 deletions

File tree

pkg/repository/olap.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3673,31 +3673,31 @@ func (p *OLAPRepositoryImpl) processSinglePartition(ctx context.Context, process
36733673
return nil
36743674
}
36753675

3676-
connStatementTimeout := 5 * 60 * 1000 // 5 minutes
3676+
// connStatementTimeout := 5 * 60 * 1000 // 5 minutes
36773677

3678-
conn, release, err := sqlchelpers.AcquireConnectionWithStatementTimeout(ctx, p.pool, p.l, connStatementTimeout)
3678+
// conn, release, err := sqlchelpers.AcquireConnectionWithStatementTimeout(ctx, p.pool, p.l, connStatementTimeout)
36793679

3680-
if err != nil {
3681-
return fmt.Errorf("failed to acquire connection with statement timeout: %w", err)
3682-
}
3680+
// if err != nil {
3681+
// return fmt.Errorf("failed to acquire connection with statement timeout: %w", err)
3682+
// }
36833683

3684-
defer release()
3684+
// defer release()
36853685

3686-
duplicatedExternalIds, err := p.ValidateNoDuplicateOLAPExternalIds(ctx, conn, partitionDate)
3686+
// duplicatedExternalIds, err := p.ValidateNoDuplicateOLAPExternalIds(ctx, conn, partitionDate)
36873687

3688-
if err != nil {
3689-
return fmt.Errorf("failed to validate no duplicate external ids: %w", err)
3690-
}
3688+
// if err != nil {
3689+
// return fmt.Errorf("failed to validate no duplicate external ids: %w", err)
3690+
// }
36913691

3692-
if len(duplicatedExternalIds) > 0 {
3693-
var duplicatedIds []string
3692+
// if len(duplicatedExternalIds) > 0 {
3693+
// var duplicatedIds []string
36943694

3695-
for _, row := range duplicatedExternalIds {
3696-
duplicatedIds = append(duplicatedIds, row.ExternalId.String())
3697-
}
3695+
// for _, row := range duplicatedExternalIds {
3696+
// duplicatedIds = append(duplicatedIds, row.ExternalId.String())
3697+
// }
36983698

3699-
return fmt.Errorf("found duplicate external ids in partition %s. Sampled ids: %s", partitionDate.String(), strings.Join(duplicatedIds, ", "))
3700-
}
3699+
// return fmt.Errorf("found duplicate external ids in partition %s. Sampled ids: %s", partitionDate.String(), strings.Join(duplicatedIds, ", "))
3700+
// }
37013701

37023702
lastExternalId := jobMeta.LastExternalId
37033703

pkg/repository/payloadstore.go

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,9 @@ func (p *payloadStoreRepositoryImpl) retrieve(ctx context.Context, tx sqlcv1.DBT
353353
key := ExternalPayloadLocationKey(payload.ExternalLocationKey.String)
354354
var retrieveFromExternalOpt RetrieveFromExternalOpts
355355

356+
// todo: this doesn't actually make sense, since
357+
// we'd never write the index file into the payload location directly
358+
// so we can remove this if block
356359
if strings.HasSuffix(string(key), ".index") {
357360
retrieveFromExternalOpt = RetrieveFromExternalOpts{
358361
Method: RetrieveFromExternalByIndexFile,
@@ -854,31 +857,31 @@ func (p *payloadStoreRepositoryImpl) processSinglePartition(ctx context.Context,
854857
return nil
855858
}
856859

857-
connStatementTimeout := 5 * 60 * 1000 // 5 minutes
860+
// connStatementTimeout := 5 * 60 * 1000 // 5 minutes
858861

859-
conn, release, err := sqlchelpers.AcquireConnectionWithStatementTimeout(ctx, p.pool, p.l, connStatementTimeout)
862+
// conn, release, err := sqlchelpers.AcquireConnectionWithStatementTimeout(ctx, p.pool, p.l, connStatementTimeout)
860863

861-
if err != nil {
862-
return fmt.Errorf("failed to acquire connection with statement timeout: %w", err)
863-
}
864+
// if err != nil {
865+
// return fmt.Errorf("failed to acquire connection with statement timeout: %w", err)
866+
// }
864867

865-
defer release()
868+
// defer release()
866869

867-
duplicatedExternalIds, err := p.ValidateNoDuplicateExternalIds(ctx, conn, partitionDate)
870+
// duplicatedExternalIds, err := p.ValidateNoDuplicateExternalIds(ctx, conn, partitionDate)
868871

869-
if err != nil {
870-
return fmt.Errorf("failed to validate no duplicate external ids: %w", err)
871-
}
872+
// if err != nil {
873+
// return fmt.Errorf("failed to validate no duplicate external ids: %w", err)
874+
// }
872875

873-
if len(duplicatedExternalIds) > 0 {
874-
var duplicatedIds []string
876+
// if len(duplicatedExternalIds) > 0 {
877+
// var duplicatedIds []string
875878

876-
for _, row := range duplicatedExternalIds {
877-
duplicatedIds = append(duplicatedIds, row.ExternalId.String())
878-
}
879+
// for _, row := range duplicatedExternalIds {
880+
// duplicatedIds = append(duplicatedIds, row.ExternalId.String())
881+
// }
879882

880-
return fmt.Errorf("found duplicate external ids in partition %s. Sampled ids: %s", partitionDate.String(), strings.Join(duplicatedIds, ", "))
881-
}
883+
// return fmt.Errorf("found duplicate external ids in partition %s. Sampled ids: %s", partitionDate.String(), strings.Join(duplicatedIds, ", "))
884+
// }
882885

883886
lastExternalId := jobMeta.LastExternalId
884887

0 commit comments

Comments
 (0)