Skip to content

Commit

Permalink
Patching ShouldDeleteFromName for MSM (artie-labs#1126)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 authored and stitch-marinus committed Jan 30, 2025
1 parent 54669f7 commit b3b16f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/destination/ddl/expiry.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ func ShouldDeleteFromName(name string) bool {
return false
}

unix, err := strconv.Atoi(suffixParts[2])
part := suffixParts[2]
if part == "msm" {
return false
}

unix, err := strconv.Atoi(part)
if err != nil {
slog.Error("Failed to parse unix string",
slog.Any("err", err),
Expand Down
1 change: 1 addition & 0 deletions lib/destination/ddl/expiry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func TestShouldDeleteFromName(t *testing.T) {
"transactions",
fmt.Sprintf("future_tbl___artie_suffix_%d", time.Now().Add(constants.TemporaryTableTTL).Unix()),
fmt.Sprintf("future_tbl___notartie_%d", time.Now().Add(-1*time.Hour).Unix()),
fmt.Sprintf("%s_foo_msm", constants.ArtiePrefix),
}

for _, tblToNotDelete := range tablesToNotDrop {
Expand Down

0 comments on commit b3b16f9

Please sign in to comment.