Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for reading from snapshot files #757

Merged
merged 141 commits into from
Jul 24, 2018
Merged
Show file tree
Hide file tree
Changes from 134 commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
8f75e2f
Update comment
Jun 13, 2018
111965b
Add volume index to reader open options matcher
Jun 13, 2018
86e721a
Add support for writing out snapshot files in writeTestData
Jun 13, 2018
01f2705
Add mostRecentCompleteSnapshotTimeByBlockShard function
Jun 13, 2018
b03d8e0
Refactor mostRecentCompleteSnapshotTimeByBlockShard
Jun 13, 2018
ba94645
Add minimumMostRecentSnapshotTimeByBlock function
Jun 13, 2018
72de5b6
Make latestVolumeForBlock guarantee checkpoint file exists
Jun 13, 2018
38ff719
Add bootstrapAvailableSnapshotFiles function
Jun 13, 2018
dfec454
Set initial injected function in commitlog bootstrapper
Jun 13, 2018
21479ee
Add SnapshotTime function and test
Jun 13, 2018
954ac66
Add SnapshotTime fn to commit log source constructor
Jun 13, 2018
9efda1a
Add test case for merging snapshot files and commit log files
Jun 13, 2018
20b23e0
Working read snapshot code
Jun 15, 2018
19c8dd7
passing prop test - data only
Jun 15, 2018
3456c7c
Fix index ns options in prop test
Jun 15, 2018
082ce98
Use random seed
Jun 15, 2018
fb6755e
remove prints
Jun 15, 2018
2caa8f5
Simplify and improve commit log filtering logic + add logs and improv…
Jun 19, 2018
8b27128
Dont read own commit logs
Jun 21, 2018
43d3872
Check immutable blocks for snapshots too
Jun 21, 2018
27f2817
Cleanup
Jun 25, 2018
7e701b6
Passing prop test with force merge
Jul 2, 2018
d398b9c
Delete unused code
Jul 2, 2018
b4e1ff2
verify checksum on bootstrap
Jul 2, 2018
e61afa0
Add integration test
Jul 2, 2018
389cdfc
Fix broken integration test
Jul 2, 2018
e7e1b1b
Fix broken integration test
Jul 2, 2018
eb44d91
Fix dtest compilation issue
Jul 2, 2018
1c6c525
Fix lint issues
Jul 3, 2018
40b7fc4
Fix lint issues
Jul 3, 2018
ab8beb4
Fix import orders
Jul 3, 2018
d44b46c
Remove prints from tests
Jul 3, 2018
1631bb8
Mark prop test as big
Jul 3, 2018
b396208
re-enable test
Jul 3, 2018
8533aa3
Fix broken test
Jul 3, 2018
5454d9b
Prop test passing with index
Jul 3, 2018
79fde45
Refactor to share more code
Jul 3, 2018
66af6a3
Factor out commit log predicate into helper
Jul 3, 2018
8e65b52
Factor out newReadCommitLogPredBasedOnAvailableSnapshotFiles
Jul 3, 2018
a08706b
Use snapshot files to generate commit log predicate for bootstrapping…
Jul 3, 2018
117653b
Delete old commit log pred generation code + tests + calculate correc…
Jul 3, 2018
95a847d
Refactor read index to only read necessary commit log files
Jul 3, 2018
f95fb54
Mark prop test as big
Jul 3, 2018
83ef7bb
Refactor readers slice constructruction to put snapshot data first an…
Jul 3, 2018
d6846c4
Refactor passing pools between functions and use encoder.Discard() in…
Jul 3, 2018
7bab886
remove encoders type and dont double close
Jul 3, 2018
88c656f
Pass legs args to function and refactor
Jul 3, 2018
8a1575d
Fix typo
Jul 3, 2018
af17969
More cleanup
Jul 3, 2018
f251b5f
Delete TODO
Jul 3, 2018
1c95f76
Delete another todo
Jul 3, 2018
f422e07
Time merge
Jul 3, 2018
8add7a3
Factor out bootstrapAvailableSnapshotFiles helper into internal
Jul 3, 2018
c09b189
Bootstrap snapshot files on-demand to save mem
Jul 3, 2018
906b413
Check commit log iter error
Jul 3, 2018
8c5c7a1
Implement and use block.Discard()
Jul 3, 2018
a92ce17
Dont double close block
Jul 3, 2018
fd87507
Remove tmpctx
Jul 3, 2018
2f8372e
More refactoring
Jul 3, 2018
dda20aa
Finalize ID and Tags when possible
Jul 3, 2018
15383f6
Reuse IDs/tags accross blocks for snapshots
Jul 3, 2018
b2af541
Revert bad commit
Jul 3, 2018
a14ce7c
Add TODO
Jul 3, 2018
c6c02b2
Undo changes to read_data_files
Jul 5, 2018
25bf972
regen mocks
Jul 5, 2018
fa1cc4c
Reformat comments
Jul 5, 2018
0fe5b31
Update comment;
Jul 5, 2018
c0321fa
Add comment
Jul 5, 2018
7c87d5d
Add period in comment
Jul 5, 2018
b90e5e3
Fix comment
Jul 5, 2018
f0d7720
Estimate shard result size
Jul 5, 2018
afd9ca0
Delete commented out code
Jul 5, 2018
07fde10
Factor our bootstrap of shard/block into helper func
Jul 5, 2018
fe59f16
Delete TODO
Jul 5, 2018
ad092a7
Propagate mostRecentCompleteSnapshotByBlockShard
Jul 5, 2018
c58c5e6
Refactor to propagate snapshot files to read around instead of just r…
Jul 6, 2018
40e727f
Remove TODOs
Jul 6, 2018
5fc018e
Improve comment
Jul 6, 2018
494ac82
Delete caching mechanism
Jul 6, 2018
93284ff
Refactor ReadIndex to bootstrap one snapshot file at a time, and dele…
Jul 6, 2018
03db28b
Fix comment spacing
Jul 6, 2018
7ec517d
Rename helper fn
Jul 6, 2018
a163e95
Dont read data / calculate checksums if were just bootstrapping the i…
Jul 6, 2018
e1852d5
Optimize tagsFromTagsIter
Jul 6, 2018
e614a36
Remove TODO
Jul 6, 2018
fecaa93
Mark ID and Tags as no finalize
Jul 6, 2018
36e0473
Remove TODO
Jul 6, 2018
7fd8742
Add TODO
Jul 6, 2018
df2ba46
Clarify TODO
Jul 6, 2018
9ced9ad
Replace panic with proper error handling
Jul 6, 2018
eca74a9
Rename helper fn for clarify
Jul 6, 2018
3881953
Rename helper fn for clarity
Jul 6, 2018
2c6b2ab
Remove TODO
Jul 6, 2018
d612302
Remove panic
Jul 6, 2018
0b6a135
Remove panic
Jul 6, 2018
c8eed4d
Add TODO
Jul 6, 2018
53e0701
Add TODO
Jul 6, 2018
819a9f9
Clarify index bootstrapping comments
Jul 6, 2018
6bdce00
Replace map keyed by unique idx with genny map
Jul 6, 2018
21fbeef
Improve error handling
Jul 6, 2018
e00241a
Remove todo
Jul 6, 2018
914c6b5
Add logger
Jul 6, 2018
29dbf98
Move tagsFromTagsiter to shared location
Jul 6, 2018
845be94
Add test for TagsFromTagsIter
Jul 6, 2018
4452b38
Reuse TagsFromTagsIter in shard.go
Jul 6, 2018
7eee44d
Fix broken integration test
Jul 6, 2018
990b4f9
Remove todo
Jul 6, 2018
cde3e5a
Refactor function lint
Jul 6, 2018
bb81e1f
Remove TODO
Jul 6, 2018
3137efc
Fix broken unit test
Jul 6, 2018
ff75311
Remove TODO
Jul 6, 2018
3329b71
Add comment
Jul 6, 2018
cb6da77
Clarify comment
Jul 6, 2018
17679f4
Refactor for readability
Jul 6, 2018
9d518dc
Mark prop test as big
Jul 6, 2018
9d94a44
Add concrete examples for bootstrapping logic
Jul 9, 2018
c0a9f28
Fix comments whitespace
Jul 9, 2018
777d55f
Fix lint issues
Jul 9, 2018
ef02320
Add regression test for unique idx bug
Jul 9, 2018
6ad08c4
Address PR feedback
Jul 11, 2018
aa03bd0
Add mixed mode read write test for snapshots
Jul 11, 2018
200cbaa
Refactor SnapshotFiles to return snapshot time
Jul 11, 2018
743dc60
Simplify files interfaces
Jul 11, 2018
08c86d8
Refactor bootstrapper to use new SnapshotTime stuff
Jul 11, 2018
aa349b3
Refactor for additional assertions
Jul 11, 2018
6a97e8a
Only decode tags if weve never seen them before
Jul 11, 2018
b27b4df
Fix logic for determinig when we should decode tags
Jul 11, 2018
2226b90
Remove TODOs
Jul 11, 2018
7ce1f03
Add comment and no finalize id/tags
Jul 11, 2018
b6a976d
Remove TODO
Jul 11, 2018
e26849d
Delete unused func
Jul 11, 2018
255b0e7
Mark prop test as big
Jul 11, 2018
1e21c50
Fix broken unit tests
Jul 11, 2018
68c968f
Infer default bufio reader size
Jul 18, 2018
68e57d3
Clarify logic and improve prop test
Jul 24, 2018
66a9644
Print time as string instead of unix timestmap
Jul 24, 2018
10d4e8a
Address comments
Jul 24, 2018
0f41cbc
Fix bug in new shardEntry
Jul 24, 2018
32f60fa
Fix bug in shard.go
Jul 24, 2018
b463402
mark prop test as big
Jul 24, 2018
da6a8ea
Fix unit tes
Jul 24, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cmd/tools/dtest/util/seed/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (g *generator) Generate(namespace ident.ID, shard uint32) error {
g.logger.Debug("created fake data")

writer := generate.NewWriter(gOpts)
err := writer.Write(namespace, shardSet, data)
err := writer.WriteData(namespace, shardSet, data)
if err != nil {
return fmt.Errorf("unable to write data: %v", err)
}
Expand Down
16 changes: 15 additions & 1 deletion src/dbnode/generated-source-files.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ genny-map-all: \
genny-map-storage \
genny-map-storage-namespace-metadata \
genny-map-storage-repair \
genny-map-storage-index-results
genny-map-storage-index-results \
genny-map-storage-bootstrap-bootstrapper-commitlog

# Map generation rule for client/receivedBlocksMap
.PHONY: genny-map-client-received-blocks
Expand Down Expand Up @@ -127,6 +128,19 @@ genny-map-storage-repair: install-m3x-repo
value_type=ReplicaSeriesBlocksMetadata \
target_package=$(m3db_package)/src/dbnode/storage/repair

# Map generation rule for storage/bootstrap/bootstrapper/commitlog
.PHONY: genny-map-storage-bootstrap-bootstrapper-commitlog
genny-map-storage-bootstrap-bootstrapper-commitlog: install-m3x-repo
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a regression test for unique index thing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add mixed_mode equivalent integration test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done (adding regression test for unique index bug)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done (adding mixed_mode equivalent integration test)

cd $(m3x_package_path) && make idhashmap-gen \
pkg=commitlog \
value_type=metadataAndEncodersByTime \
target_package=$(m3db_package)/src/dbnode/storage/bootstrap/bootstrapper/commitlog \
rename_constructor=newMetadataAndEncodersByTimeMap \
rename_constructor_options=newMetadataAndEncodersByTimeMapOptions
# Rename both generated map and constructor files
mv -f $(m3db_package_path)/src/dbnode/storage/bootstrap/bootstrapper/commitlog/map_gen.go $(m3db_package_path)/src/dbnode/storage/bootstrap/bootstrapper/commitlog/metadata_and_encoders_by_time_map_gen.go
mv -f $(m3db_package_path)/src/dbnode/storage/bootstrap/bootstrapper/commitlog/new_map_gen.go $(m3db_package_path)/src/dbnode/storage/bootstrap/bootstrapper/commitlog/metadata_and_encoders_by_time_new_map_gen.go

# Map generation rule for storage/index/ResultsMap
.PHONY: genny-map-storage-index-results
genny-map-storage-index-results: install-m3x-repo
Expand Down
5 changes: 3 additions & 2 deletions src/dbnode/integration/admin_session_fetch_blocks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ func testSetupToSeriesMaps(
nsMetadata namespace.Metadata,
metadatasByShard map[uint32][]block.ReplicaMetadata,
) map[xtime.UnixNano]generate.SeriesBlock {
blockSize := nsMetadata.Options().RetentionOptions().BlockSize()
seriesMap := make(map[xtime.UnixNano]generate.SeriesBlock)
resultOpts := newDefaulTestResultOptions(testSetup.storageOpts)
consistencyLevel := testSetup.storageOpts.RepairOptions().RepairConsistencyLevel()
Expand Down Expand Up @@ -201,12 +202,12 @@ func testSetupToSeriesMaps(
ctx.Close()

firstTs := datapoints[0].Timestamp
seriesMapList := seriesMap[xtime.ToUnixNano(firstTs)]
seriesMapList := seriesMap[xtime.ToUnixNano(firstTs.Truncate(blockSize))]
seriesMapList = append(seriesMapList, generate.Series{
ID: id,
Data: datapoints,
})
seriesMap[xtime.ToUnixNano(firstTs)] = seriesMapList
seriesMap[xtime.ToUnixNano(firstTs.Truncate(blockSize))] = seriesMapList
}
require.NoError(t, blocksIter.Err())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func TestBootstrapAfterBufferRotation(t *testing.T) {
},
},
}
writeCommitLogData(t, setup, commitLogOpts, seriesMaps, ns1.ID())
writeCommitLogData(t, setup, commitLogOpts, seriesMaps, ns1, false)

// Setup bootstrappers - We order them such that the custom test bootstrapper runs first
// which does not bootstrap any data, but simply waits until it is signaled, allowing us
Expand Down Expand Up @@ -182,7 +182,7 @@ func TestBootstrapAfterBufferRotation(t *testing.T) {
// Verify in-memory data match what we expect - both commitlog and memory write
// should be present.
expectedSeriesMaps := map[xtime.UnixNano]generate.SeriesBlock{
xtime.ToUnixNano(commitlogWrite.Timestamp): generate.SeriesBlock{
xtime.ToUnixNano(commitlogWrite.Timestamp.Truncate(blockSize)): generate.SeriesBlock{
generate.Series{
ID: testID,
Data: []ts.Datapoint{commitlogWrite, memoryWrite},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func TestBootstrapBeforeBufferRotationNoTick(t *testing.T) {
},
},
}
writeCommitLogData(t, setup, commitLogOpts, seriesMaps, ns1.ID())
writeCommitLogData(t, setup, commitLogOpts, seriesMaps, ns1, false)

// Setup bootstrappers - We order them such that the custom test bootstrapper runs first
// which does not bootstrap any data, but simply waits until it is signaled, allowing us
Expand Down Expand Up @@ -202,7 +202,7 @@ func TestBootstrapBeforeBufferRotationNoTick(t *testing.T) {

// Verify in-memory data match what we expect - commitlog write should not be lost
expectedSeriesMaps := map[xtime.UnixNano]generate.SeriesBlock{
xtime.ToUnixNano(commitlogWrite.Timestamp): generate.SeriesBlock{
xtime.ToUnixNano(commitlogWrite.Timestamp.Truncate(blockSize)): generate.SeriesBlock{
generate.Series{
ID: testID,
Data: []ts.Datapoint{commitlogWrite},
Expand Down
54 changes: 46 additions & 8 deletions src/dbnode/integration/commitlog_bootstrap_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/m3db/m3db/src/dbnode/integration/generate"
"github.com/m3db/m3db/src/dbnode/persist/fs"
"github.com/m3db/m3db/src/dbnode/persist/fs/commitlog"
"github.com/m3db/m3db/src/dbnode/storage/namespace"
"github.com/m3db/m3x/context"
"github.com/m3db/m3x/ident"
xtime "github.com/m3db/m3x/time"
Expand Down Expand Up @@ -89,7 +90,7 @@ func generateSeriesMaps(numBlocks int, starts ...time.Time) generate.SeriesBlock
blockConfig = append(blockConfig, generate.BlockConfig{
IDs: name,
NumPoints: rand.Intn(100) + 1,
Start: start.Add(time.Duration(i) * time.Minute),
Start: start,
})
}
return generate.BlocksByStart(blockConfig)
Expand All @@ -100,30 +101,48 @@ func writeCommitLogData(
s *testSetup,
opts commitlog.Options,
data generate.SeriesBlocksByStart,
namespace ident.ID,
namespace namespace.Metadata,
genSnapshots bool,
) {
writeCommitLogDataBase(t, s, opts, data, namespace, nil)
writeCommitLogDataBase(t, s, opts, data, namespace, nil, nil)
}

func writeCommitLogDataSpecifiedTS(
t *testing.T,
s *testSetup,
opts commitlog.Options,
data generate.SeriesBlocksByStart,
namespace ident.ID,
namespace namespace.Metadata,
ts time.Time,
genSnapshots bool,
) {
writeCommitLogDataBase(t, s, opts, data, namespace, &ts)
writeCommitLogDataBase(t, s, opts, data, namespace, &ts, nil)
}

func writeCommitLogDataWithPredicate(
t *testing.T,
s *testSetup,
opts commitlog.Options,
data generate.SeriesBlocksByStart,
namespace namespace.Metadata,
pred generate.WriteDatapointPredicate,
) {
writeCommitLogDataBase(t, s, opts, data, namespace, nil, pred)
}

func writeCommitLogDataBase(
t *testing.T,
s *testSetup,
opts commitlog.Options,
data generate.SeriesBlocksByStart,
namespace ident.ID,
namespace namespace.Metadata,
specifiedTS *time.Time,
pred generate.WriteDatapointPredicate,
) {
if pred == nil {
pred = generate.WriteAllPredicate
}

// ensure commit log is flushing frequently
require.Equal(t, defaultIntegrationTestFlushInterval, opts.FlushInterval())

Expand All @@ -132,6 +151,7 @@ func writeCommitLogDataBase(
shardSet = s.shardSet
)

// Write out commit log data
for ts, blk := range data {
if specifiedTS != nil {
s.setNowFn(*specifiedTS)
Expand Down Expand Up @@ -160,20 +180,38 @@ func writeCommitLogDataBase(
series, ok := seriesLookup[point.ID.String()]
require.True(t, ok)
cId := commitlog.Series{
Namespace: namespace,
Namespace: namespace.ID(),
Shard: shardSet.Lookup(point.ID),
ID: point.ID,
Tags: series.tags,
UniqueIndex: series.uniqueIndex,
}
require.NoError(t, commitLog.Write(ctx, cId, point.Datapoint, xtime.Second, nil))
if pred(point.Datapoint) {
require.NoError(t, commitLog.Write(ctx, cId, point.Datapoint, xtime.Second, nil))
}
}

// ensure writes finished
require.NoError(t, commitLog.Close())
}
}

func writeSnapshotsWithPredicate(
t *testing.T,
s *testSetup,
opts commitlog.Options,
data generate.SeriesBlocksByStart,
namespace namespace.Metadata,
specifiedTS *time.Time,
pred generate.WriteDatapointPredicate,
snapshotInterval time.Duration,
) {
// Write out snapshots
err := writeTestSnapshotsToDiskWithPredicate(
namespace, s, data, pred, snapshotInterval)
require.NoError(t, err)
}

func mustInspectFilesystem(fsOpts fs.Options) fs.Inspection {
inspection, err := fs.InspectFilesystem(fsOpts)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions src/dbnode/integration/commitlog_bootstrap_index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ func TestCommitLogIndexBootstrap(t *testing.T) {
})

log.Info("writing data")
writeCommitLogData(t, setup, commitLogOpts, seriesMaps, testNamespaces[0])
writeCommitLogData(t, setup, commitLogOpts, seriesMaps, testNamespaces[1])
writeCommitLogData(t, setup, commitLogOpts, seriesMaps, ns1, false)
writeCommitLogData(t, setup, commitLogOpts, seriesMaps, ns2, false)
log.Info("finished writing data")

// Setup bootstrapper after writing data so filesystem inspection can find it.
Expand Down
2 changes: 1 addition & 1 deletion src/dbnode/integration/commitlog_bootstrap_merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func TestCommitLogAndFSMergeBootstrap(t *testing.T) {
t1Nano: seriesMaps[t1Nano],
t2Nano: seriesMaps[t2Nano],
}
writeCommitLogData(t, setup, commitLogOpts, commitlogSeriesMaps, ns1.ID())
writeCommitLogData(t, setup, commitLogOpts, commitlogSeriesMaps, ns1, false)

// commit log bootstrapper (must be after writing out commitlog files so inspection finds files)
noOpAll := bootstrapper.NewNoOpAllBootstrapperProvider()
Expand Down
4 changes: 2 additions & 2 deletions src/dbnode/integration/commitlog_bootstrap_multi_ns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func TestCommitLogBootstrapMultipleNamespaces(t *testing.T) {

setup.namespaceMetadataOrFail(testNamespaces[0])
log.Info("writing data - ns1")
writeCommitLogData(t, setup, commitLogOpts, ns1SeriesMap, testNamespaces[0])
writeCommitLogData(t, setup, commitLogOpts, ns1SeriesMap, ns1, false)
log.Info("written data - ns1")

// Write test data for ns2
Expand All @@ -96,7 +96,7 @@ func TestCommitLogBootstrapMultipleNamespaces(t *testing.T) {
})
setup.namespaceMetadataOrFail(testNamespaces[1])
log.Info("writing data - ns2")
writeCommitLogData(t, setup, commitLogOpts, ns2SeriesMap, testNamespaces[1])
writeCommitLogData(t, setup, commitLogOpts, ns2SeriesMap, ns2, false)
log.Info("written data - ns2")

// Setup bootstrapper after writing data so filesystem inspection can find it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ func TestCommitLogBootstrapOnlyReadsRequiredFiles(t *testing.T) {
now := setup.getNowFn()
seriesMaps := generateSeriesMaps(30, now.Add(-2*blockSize), now.Add(-blockSize))
log.Info("writing data")
writeCommitLogData(t, setup, commitLogOpts, seriesMaps, testNamespaces[0])
writeCommitLogData(t, setup, commitLogOpts, seriesMaps, ns1, false)
log.Info("finished writing data")

// The datapoints in this generated data are within the retention period and
// would oridinarly be bootstrapped, however, we intentionally write them to a
// would ordinarily be bootstrapped, however, we intentionally write them to a
// commitlog file that has a timestamp outside of the retention period. This
// allows us to verify the commitlog bootstrapping logic will not waste time
// reading commitlog files that are outside of the retention period.
Expand All @@ -84,8 +84,9 @@ func TestCommitLogBootstrapOnlyReadsRequiredFiles(t *testing.T) {
setup,
commitLogOpts,
seriesMapsExpiredCommitlog,
testNamespaces[0],
ns1,
now.Add(-2*ropts.RetentionPeriod()),
false,
)
log.Info("finished writing data to commitlog file with out of range timestamp")

Expand Down
4 changes: 2 additions & 2 deletions src/dbnode/integration/commitlog_bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestCommitLogBootstrap(t *testing.T) {
now := setup.getNowFn()
seriesMaps := generateSeriesMaps(30, now.Add(-2*blockSize), now.Add(-blockSize))
log.Info("writing data")
writeCommitLogData(t, setup, commitLogOpts, seriesMaps, testNamespaces[0])
writeCommitLogData(t, setup, commitLogOpts, seriesMaps, ns1, false)
log.Info("finished writing data")

// Setup bootstrapper after writing data so filesystem inspection can find it.
Expand Down Expand Up @@ -106,7 +106,7 @@ func TestCommitLogBootstrap(t *testing.T) {
verifySeriesMapsEqual(t, seriesMaps, observedSeriesMaps)

// Verify in-memory data match what we expect - no writes should be present
// because we didn't issue any writes for this namespaces
// because we didn't issue any writes for this namespace.
emptySeriesMaps := make(generate.SeriesBlocksByStart)
metadatasByShard2 := testSetupMetadatas(t, setup, testNamespaces[1], now.Add(-2*blockSize), now)
observedSeriesMaps2 := testSetupToSeriesMaps(t, setup, ns2, metadatasByShard2)
Expand Down
Loading