From 547cca69c51690df177f858bad5394b35e70707c Mon Sep 17 00:00:00 2001 From: hillium Date: Tue, 7 Jan 2025 12:24:24 +0800 Subject: [PATCH 1/6] use input ts as filter Signed-off-by: hillium --- br/pkg/restore/log_client/export_test.go | 4 + br/pkg/restore/log_client/migration.go | 6 +- br/pkg/restore/log_client/migration_test.go | 112 +++++++++++++++++--- go.mod | 3 +- go.sum | 3 + 5 files changed, 114 insertions(+), 14 deletions(-) diff --git a/br/pkg/restore/log_client/export_test.go b/br/pkg/restore/log_client/export_test.go index f78a54bf50c8a..1aaa472348ff8 100644 --- a/br/pkg/restore/log_client/export_test.go +++ b/br/pkg/restore/log_client/export_test.go @@ -127,3 +127,7 @@ func (helper *FakeStreamMetadataHelper) ReadFile( ) ([]byte, error) { return helper.Data[offset : offset+length], nil } + +func (m WithMigrations) CompactionDirs() []string { + return m.compactionDirs +} diff --git a/br/pkg/restore/log_client/migration.go b/br/pkg/restore/log_client/migration.go index a7b4307e0f568..c01a2f5095062 100644 --- a/br/pkg/restore/log_client/migration.go +++ b/br/pkg/restore/log_client/migration.go @@ -133,7 +133,11 @@ func (builder *WithMigrationsBuilder) coarseGrainedFilter(mig *backuppb.Migratio // log file [ .. .. .. .. ] // for _, compaction := range mig.Compactions { - if compaction.CompactionUntilTs < builder.shiftStartTS || compaction.CompactionFromTs > builder.restoredTS { + // Some old compaction may not contain input min / max ts. + // In that case, we should never filter it out. + rangeValid := compaction.InputMinTs != 0 && compaction.InputMaxTs != 0 + outOfRange := compaction.InputMaxTs < builder.shiftStartTS || compaction.InputMinTs > builder.restoredTS + if rangeValid && outOfRange { return true } } diff --git a/br/pkg/restore/log_client/migration_test.go b/br/pkg/restore/log_client/migration_test.go index 5368d7416dadf..20bf090082377 100644 --- a/br/pkg/restore/log_client/migration_test.go +++ b/br/pkg/restore/log_client/migration_test.go @@ -215,8 +215,8 @@ func TestMigrations(t *testing.T) { }, Compactions: []*backuppb.LogFileCompaction{ { - CompactionFromTs: 0, - CompactionUntilTs: 9, + InputMinTs: 0, + InputMaxTs: 9, }, }, }, @@ -240,8 +240,8 @@ func TestMigrations(t *testing.T) { }, Compactions: []*backuppb.LogFileCompaction{ { - CompactionFromTs: 50, - CompactionUntilTs: 52, + InputMinTs: 50, + InputMaxTs: 52, }, }, }, @@ -264,8 +264,8 @@ func TestMigrations(t *testing.T) { }, Compactions: []*backuppb.LogFileCompaction{ { - CompactionFromTs: 50, - CompactionUntilTs: 52, + InputMinTs: 50, + InputMaxTs: 52, }, }, }, @@ -275,8 +275,8 @@ func TestMigrations(t *testing.T) { }, Compactions: []*backuppb.LogFileCompaction{ { - CompactionFromTs: 120, - CompactionUntilTs: 140, + InputMinTs: 120, + InputMaxTs: 140, }, }, }, @@ -299,8 +299,8 @@ func TestMigrations(t *testing.T) { }, Compactions: []*backuppb.LogFileCompaction{ { - CompactionFromTs: 50, - CompactionUntilTs: 52, + InputMinTs: 50, + InputMaxTs: 52, }, }, }, @@ -310,8 +310,8 @@ func TestMigrations(t *testing.T) { }, Compactions: []*backuppb.LogFileCompaction{ { - CompactionFromTs: 1200, - CompactionUntilTs: 1400, + InputMinTs: 1200, + InputMaxTs: 1400, }, }, }, @@ -350,3 +350,91 @@ func TestMigrations(t *testing.T) { } } } + +func pack[T any](ts ...T) []T { + return ts +} + +func TestFilterOut(t *testing.T) { + type Case struct { + ShiftedStartTs uint64 + RestoredTs uint64 + Migs []*backuppb.Migration + + ExceptedCompactionsArtificateDir []string + } + withCompactTsCompaction := func(iMin, iMax, cFrom, cUntil uint64, name string) *backuppb.LogFileCompaction { + return &backuppb.LogFileCompaction{ + InputMinTs: iMin, + InputMaxTs: iMax, + CompactionFromTs: cFrom, + CompactionUntilTs: cUntil, + Artifacts: name, + } + } + simpleCompaction := func(iMin, iMax uint64, name string) *backuppb.LogFileCompaction { + return &backuppb.LogFileCompaction{ + InputMinTs: iMin, + InputMaxTs: iMax, + Artifacts: name, + } + } + makeMig := func(cs ...*backuppb.LogFileCompaction) *backuppb.Migration { + return &backuppb.Migration{Compactions: cs} + } + + cases := []Case{ + { + ShiftedStartTs: 50, + RestoredTs: 60, + Migs: pack( + makeMig(simpleCompaction(49, 61, "a")), + makeMig(simpleCompaction(61, 80, "b")), + ), + + ExceptedCompactionsArtificateDir: pack("a"), + }, + { + ShiftedStartTs: 30, + RestoredTs: 50, + Migs: pack( + makeMig(simpleCompaction(40, 60, "1a")), + makeMig(simpleCompaction(10, 20, "1b")), + makeMig(simpleCompaction(31, 50, "2a")), + makeMig(simpleCompaction(50, 80, "2b")), + ), + + ExceptedCompactionsArtificateDir: pack("1a", "2a", "2b"), + }, + { + ShiftedStartTs: 30, + RestoredTs: 50, + Migs: pack( + makeMig(withCompactTsCompaction(49, 100, 50, 99, "a")), + makeMig(withCompactTsCompaction(10, 30, 15, 29, "b")), + makeMig(withCompactTsCompaction(8, 29, 10, 20, "c")), + ), + + ExceptedCompactionsArtificateDir: pack("a", "b"), + }, + { + ShiftedStartTs: 100, + RestoredTs: 120, + Migs: pack( + makeMig(withCompactTsCompaction(49, 100, 50, 99, "a")), + makeMig(withCompactTsCompaction(0, 0, 15, 29, "b")), + makeMig(withCompactTsCompaction(0, 0, 10, 20, "c")), + ), + + ExceptedCompactionsArtificateDir: pack("a", "b", "c"), + }, + } + + for i, c := range cases { + t.Run(fmt.Sprintf("#%d", i), func(t *testing.T) { + b := logclient.NewMigrationBuilder(c.ShiftedStartTs, c.ShiftedStartTs, c.RestoredTs) + i := b.Build(c.Migs) + require.ElementsMatch(t, i.CompactionDirs(), c.ExceptedCompactionsArtificateDir) + }) + } +} diff --git a/go.mod b/go.mod index 7e9a0ac1a907d..07dbda709afc1 100644 --- a/go.mod +++ b/go.mod @@ -87,7 +87,7 @@ require ( github.com/pingcap/errors v0.11.5-0.20240318064555-6bd07397691f github.com/pingcap/failpoint v0.0.0-20240528011301-b51a646c7c86 github.com/pingcap/fn v1.0.0 - github.com/pingcap/kvproto v0.0.0-20241120071417-b5b7843d9037 + github.com/pingcap/kvproto v0.0.0-20250102071301-c35d2b410115 github.com/pingcap/log v1.1.1-0.20241212030209-7e3ff8601a2a github.com/pingcap/sysutil v1.0.1-0.20240311050922-ae81ee01f3a5 github.com/pingcap/tidb/pkg/parser v0.0.0-20211011031125-9b13dc409c5e @@ -158,6 +158,7 @@ require ( github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect + github.com/ghodss/yaml v1.0.0 // indirect github.com/goccy/go-reflect v1.2.0 // indirect github.com/google/flatbuffers v2.0.8+incompatible // indirect github.com/jinzhu/inflection v1.0.0 // indirect diff --git a/go.sum b/go.sum index 0e36eb7a11528..d0be7ff7cb79f 100644 --- a/go.sum +++ b/go.sum @@ -263,6 +263,7 @@ github.com/fsouza/fake-gcs-server v1.44.0/go.mod h1:M02aKoTv9Tnlf+gmWnTok1PWVCUH github.com/fzipp/gocyclo v0.3.1/go.mod h1:DJHO6AUmbdqj2ET4Z9iArSuwWgYDRryYt2wASxc7x3E= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-asn1-ber/asn1-ber v1.5.4 h1:vXT6d/FNDiELJnLb6hGNa309LMsrCoYFvpwHDF0+Y1A= github.com/go-asn1-ber/asn1-ber v1.5.4/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= @@ -678,6 +679,8 @@ github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989/go.mod h1:O17Xtb github.com/pingcap/kvproto v0.0.0-20191211054548-3c6b38ea5107/go.mod h1:WWLmULLO7l8IOcQG+t+ItJ3fEcrL5FxF0Wu+HrMy26w= github.com/pingcap/kvproto v0.0.0-20241120071417-b5b7843d9037 h1:xYNSJjYNur4Dr5bV+9BXK9n5E0T1zlcAN25XX68+mOg= github.com/pingcap/kvproto v0.0.0-20241120071417-b5b7843d9037/go.mod h1:rXxWk2UnwfUhLXha1jxRWPADw9eMZGWEWCg92Tgmb/8= +github.com/pingcap/kvproto v0.0.0-20250102071301-c35d2b410115 h1:tFaBKtuVsTaYgWVa4fJVBHEi3vqdqRtmjMypEK+CN88= +github.com/pingcap/kvproto v0.0.0-20250102071301-c35d2b410115/go.mod h1:rXxWk2UnwfUhLXha1jxRWPADw9eMZGWEWCg92Tgmb/8= github.com/pingcap/log v0.0.0-20210625125904-98ed8e2eb1c7/go.mod h1:8AanEdAHATuRurdGxZXBz0At+9avep+ub7U1AGYLIMM= github.com/pingcap/log v1.1.0/go.mod h1:DWQW5jICDR7UJh4HtxXSM20Churx4CQL0fwL/SoOSA4= github.com/pingcap/log v1.1.1-0.20241212030209-7e3ff8601a2a h1:WIhmJBlNGmnCWH6TLMdZfNEDaiU8cFpZe3iaqDbQ0M8= From 5c25d5b93b02dca4f54f23547370c56b9a6ea3b3 Mon Sep 17 00:00:00 2001 From: hillium Date: Tue, 7 Jan 2025 12:26:35 +0800 Subject: [PATCH 2/6] make bazel_prepare Signed-off-by: hillium --- br/pkg/restore/log_client/BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/br/pkg/restore/log_client/BUILD.bazel b/br/pkg/restore/log_client/BUILD.bazel index 7fb781e7ad0ef..78e588639bcb4 100644 --- a/br/pkg/restore/log_client/BUILD.bazel +++ b/br/pkg/restore/log_client/BUILD.bazel @@ -90,7 +90,7 @@ go_test( ], embed = [":log_client"], flaky = True, - shard_count = 45, + shard_count = 46, deps = [ "//br/pkg/errors", "//br/pkg/glue", From 47bace052f59f836dbe71e241dc62fbe3708794a Mon Sep 17 00:00:00 2001 From: hillium Date: Tue, 7 Jan 2025 13:30:56 +0800 Subject: [PATCH 3/6] update DEPS.bzl Signed-off-by: hillium --- DEPS.bzl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DEPS.bzl b/DEPS.bzl index bf4ee0e36d695..004078cbd9108 100644 --- a/DEPS.bzl +++ b/DEPS.bzl @@ -5867,13 +5867,13 @@ def go_deps(): name = "com_github_pingcap_kvproto", build_file_proto_mode = "disable_global", importpath = "github.com/pingcap/kvproto", - sha256 = "92a67bcc499c06fd3d76cc153362540b22eaf1b09c4bda62a1599ce876b8ed78", - strip_prefix = "github.com/pingcap/kvproto@v0.0.0-20241120071417-b5b7843d9037", + sha256 = "db34e3f94e5ac8fc5465b5440583c9e037a7f16aea8d0d8a200cdff210b12038", + strip_prefix = "github.com/pingcap/kvproto@v0.0.0-20250102071301-c35d2b410115", urls = [ - "http://bazel-cache.pingcap.net:8080/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20241120071417-b5b7843d9037.zip", - "http://ats.apps.svc/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20241120071417-b5b7843d9037.zip", - "https://cache.hawkingrei.com/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20241120071417-b5b7843d9037.zip", - "https://storage.googleapis.com/pingcapmirror/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20241120071417-b5b7843d9037.zip", + "http://bazel-cache.pingcap.net:8080/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20250102071301-c35d2b410115.zip", + "http://ats.apps.svc/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20250102071301-c35d2b410115.zip", + "https://cache.hawkingrei.com/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20250102071301-c35d2b410115.zip", + "https://storage.googleapis.com/pingcapmirror/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20250102071301-c35d2b410115.zip", ], ) go_repository( From 9af012fe02b37743ec5d5cede522c7ba9bb8f90d Mon Sep 17 00:00:00 2001 From: hillium Date: Tue, 7 Jan 2025 16:11:59 +0800 Subject: [PATCH 4/6] support `FlushNow`. Signed-off-by: hillium --- br/pkg/streamhelper/basic_lib_for_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/br/pkg/streamhelper/basic_lib_for_test.go b/br/pkg/streamhelper/basic_lib_for_test.go index 22fa031854fbe..3d0bf84ac4f78 100644 --- a/br/pkg/streamhelper/basic_lib_for_test.go +++ b/br/pkg/streamhelper/basic_lib_for_test.go @@ -179,6 +179,11 @@ func (t trivialFlushStream) RecvMsg(m any) error { return nil } +func (f *fakeStore) FlushNow(ctx context.Context, in *logbackup.FlushNowRequest, opts ...grpc.CallOption) (*logbackup.FlushNowResponse, error) { + f.flush() + return &logbackup.FlushNowResponse{Results: []*logbackup.FlushResult{{TaskName: "Universe", Success: true}}}, nil +} + func (f *fakeStore) GetID() uint64 { return f.id } From de4fab96e08a1f2e503faaee72b9b55c1eb07aeb Mon Sep 17 00:00:00 2001 From: hillium Date: Tue, 7 Jan 2025 17:42:28 +0800 Subject: [PATCH 5/6] make tidy Signed-off-by: hillium --- go.mod | 1 - go.sum | 3 --- 2 files changed, 4 deletions(-) diff --git a/go.mod b/go.mod index 07dbda709afc1..fedc63af66beb 100644 --- a/go.mod +++ b/go.mod @@ -158,7 +158,6 @@ require ( github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect - github.com/ghodss/yaml v1.0.0 // indirect github.com/goccy/go-reflect v1.2.0 // indirect github.com/google/flatbuffers v2.0.8+incompatible // indirect github.com/jinzhu/inflection v1.0.0 // indirect diff --git a/go.sum b/go.sum index d0be7ff7cb79f..9923e553c66c6 100644 --- a/go.sum +++ b/go.sum @@ -263,7 +263,6 @@ github.com/fsouza/fake-gcs-server v1.44.0/go.mod h1:M02aKoTv9Tnlf+gmWnTok1PWVCUH github.com/fzipp/gocyclo v0.3.1/go.mod h1:DJHO6AUmbdqj2ET4Z9iArSuwWgYDRryYt2wASxc7x3E= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-asn1-ber/asn1-ber v1.5.4 h1:vXT6d/FNDiELJnLb6hGNa309LMsrCoYFvpwHDF0+Y1A= github.com/go-asn1-ber/asn1-ber v1.5.4/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= @@ -677,8 +676,6 @@ github.com/pingcap/fn v1.0.0/go.mod h1:u9WZ1ZiOD1RpNhcI42RucFh/lBuzTu6rw88a+oF2Z github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989 h1:surzm05a8C9dN8dIUmo4Be2+pMRb6f55i+UIYrluu2E= github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989/go.mod h1:O17XtbryoCJhkKGbT62+L2OlrniwqiGLSqrmdHCMzZw= github.com/pingcap/kvproto v0.0.0-20191211054548-3c6b38ea5107/go.mod h1:WWLmULLO7l8IOcQG+t+ItJ3fEcrL5FxF0Wu+HrMy26w= -github.com/pingcap/kvproto v0.0.0-20241120071417-b5b7843d9037 h1:xYNSJjYNur4Dr5bV+9BXK9n5E0T1zlcAN25XX68+mOg= -github.com/pingcap/kvproto v0.0.0-20241120071417-b5b7843d9037/go.mod h1:rXxWk2UnwfUhLXha1jxRWPADw9eMZGWEWCg92Tgmb/8= github.com/pingcap/kvproto v0.0.0-20250102071301-c35d2b410115 h1:tFaBKtuVsTaYgWVa4fJVBHEi3vqdqRtmjMypEK+CN88= github.com/pingcap/kvproto v0.0.0-20250102071301-c35d2b410115/go.mod h1:rXxWk2UnwfUhLXha1jxRWPADw9eMZGWEWCg92Tgmb/8= github.com/pingcap/log v0.0.0-20210625125904-98ed8e2eb1c7/go.mod h1:8AanEdAHATuRurdGxZXBz0At+9avep+ub7U1AGYLIMM= From b354265c8ed446d05637eea2c4e990373df4b33b Mon Sep 17 00:00:00 2001 From: hillium Date: Wed, 8 Jan 2025 17:41:47 +0800 Subject: [PATCH 6/6] fix test case --- br/pkg/restore/log_client/migration_test.go | 38 +++++++++++---------- br/pkg/stream/stream_metas.go | 5 +-- br/pkg/stream/stream_metas_test.go | 6 ++-- 3 files changed, 26 insertions(+), 23 deletions(-) diff --git a/br/pkg/restore/log_client/migration_test.go b/br/pkg/restore/log_client/migration_test.go index 20bf090082377..f0c99439e3ae5 100644 --- a/br/pkg/restore/log_client/migration_test.go +++ b/br/pkg/restore/log_client/migration_test.go @@ -215,7 +215,7 @@ func TestMigrations(t *testing.T) { }, Compactions: []*backuppb.LogFileCompaction{ { - InputMinTs: 0, + InputMinTs: 1, InputMaxTs: 9, }, }, @@ -329,25 +329,27 @@ func TestMigrations(t *testing.T) { } ctx := context.Background() - for _, cs := range cases { - builder := logclient.NewMigrationBuilder(10, 100, 200) - withMigrations := builder.Build(cs.migrations) - it := withMigrations.Metas(generateMetaNameIter()) - checkMetaNameIter(t, cs.expectStoreIds, it) - it = withMigrations.Metas(generateMetaNameIter()) - collect := iter.CollectAll(ctx, it) - require.NoError(t, collect.Err) - for j, meta := range collect.Item { - physicalIter := generatePhysicalIter(meta) - checkPhysicalIter(t, cs.expectPhyLengths[j], physicalIter) - physicalIter = generatePhysicalIter(meta) - collect := iter.CollectAll(ctx, physicalIter) + for i, cs := range cases { + t.Run(fmt.Sprintf("#%d", i), func(t *testing.T) { + builder := logclient.NewMigrationBuilder(10, 100, 200) + withMigrations := builder.Build(cs.migrations) + it := withMigrations.Metas(generateMetaNameIter()) + checkMetaNameIter(t, cs.expectStoreIds, it) + it = withMigrations.Metas(generateMetaNameIter()) + collect := iter.CollectAll(ctx, it) require.NoError(t, collect.Err) - for k, phy := range collect.Item { - logicalIter := generateLogicalIter(phy) - checkLogicalIter(t, cs.expectLogLengths[j][k], logicalIter) + for j, meta := range collect.Item { + physicalIter := generatePhysicalIter(meta) + checkPhysicalIter(t, cs.expectPhyLengths[j], physicalIter) + physicalIter = generatePhysicalIter(meta) + collect := iter.CollectAll(ctx, physicalIter) + require.NoError(t, collect.Err) + for k, phy := range collect.Item { + logicalIter := generateLogicalIter(phy) + checkLogicalIter(t, cs.expectLogLengths[j][k], logicalIter) + } } - } + }) } } diff --git a/br/pkg/stream/stream_metas.go b/br/pkg/stream/stream_metas.go index 6801035ce7214..11e449dbe4097 100644 --- a/br/pkg/stream/stream_metas.go +++ b/br/pkg/stream/stream_metas.go @@ -1073,8 +1073,9 @@ func (m MigrationExt) doTruncating(ctx context.Context, mig *pb.Migration, resul // NOTE: Execution of truncation wasn't implemented here. // If we are going to truncate some files, for now we still need to use `br log truncate`. for _, compaction := range mig.Compactions { - // Can we also remove the compaction when `until-ts` is equal to `truncated-to`...? - if compaction.CompactionUntilTs > mig.TruncatedTo { + // We can only clean up a compaction when we are sure all its inputs + // are no more used. + if compaction.InputMaxTs > mig.TruncatedTo { result.NewBase.Compactions = append(result.NewBase.Compactions, compaction) } else { m.tryRemovePrefix(ctx, compaction.Artifacts, result) diff --git a/br/pkg/stream/stream_metas_test.go b/br/pkg/stream/stream_metas_test.go index c0fcbbae623ce..8279707b65b09 100644 --- a/br/pkg/stream/stream_metas_test.go +++ b/br/pkg/stream/stream_metas_test.go @@ -452,13 +452,13 @@ func mDstrPfx(path ...string) migOP { } } -func mCompaction(cPath, aPath string, fromTs, untilTs uint64) migOP { +func mCompaction(cPath, aPath string, minTs, maxTs uint64) migOP { return func(m *backuppb.Migration) { c := &backuppb.LogFileCompaction{} c.GeneratedFiles = cPath c.Artifacts = aPath - c.CompactionFromTs = fromTs - c.CompactionUntilTs = untilTs + c.InputMinTs = minTs + c.InputMaxTs = maxTs m.Compactions = append(m.Compactions, c) } }