mirror of
https://github.com/dolthub/dolt.git
synced 2025-12-30 16:12:39 -06:00
PR Feedback
This commit is contained in:
@@ -795,7 +795,7 @@ func planArchiveConjoin(sources []sourceWithSize, stats *Stats) (compactionPlan,
|
||||
|
||||
// place largest chunk sources at the beginning of the conjoin
|
||||
orderedSrcs := chunkSourcesByDescendingDataSize{sws: sources}
|
||||
// sort.Sort(orderedSrcs)
|
||||
sort.Sort(orderedSrcs)
|
||||
sources = nil
|
||||
|
||||
writer := NewBlockBufferByteSink(fourMb)
|
||||
@@ -809,12 +809,7 @@ func planArchiveConjoin(sources []sourceWithSize, stats *Stats) (compactionPlan,
|
||||
arcSrc, ok := reader.(archiveChunkSource)
|
||||
if !ok {
|
||||
// When it's not an archive, we want to use the table index to extract chunk records one at a time.
|
||||
tblSrc, ok := reader.(chunkSource)
|
||||
if !ok {
|
||||
return compactionPlan{}, fmt.Errorf("runtime error: source %T is not an archiveChunkSource or fileTableReader", reader)
|
||||
}
|
||||
|
||||
index, err := tblSrc.index()
|
||||
index, err := reader.index()
|
||||
if err != nil {
|
||||
return compactionPlan{}, err
|
||||
}
|
||||
|
||||
@@ -2386,7 +2386,7 @@ func (nbs *NomsBlockStore) ConjoinTableFiles(ctx context.Context, storageIds []h
|
||||
}
|
||||
|
||||
// findTableSpec finds a table spec by hash in the current manifest. This will ignore novel tables, as it's not
|
||||
// needed currently. This function also checks for archive files via the persister.
|
||||
// needed currently.
|
||||
func (nbs *NomsBlockStore) findTableSpec(storageId hash.Hash) (tableSpec, bool) {
|
||||
for _, spec := range nbs.upstream.specs {
|
||||
if spec.name == storageId {
|
||||
@@ -2402,18 +2402,5 @@ func (nbs *NomsBlockStore) findTableSpec(storageId hash.Hash) (tableSpec, bool)
|
||||
return tableSpec{name: storageId, chunkCount: count}, true
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the storage ID corresponds to an archive file by attempting to open it
|
||||
// The persister's Open method will check for both table files and archive files
|
||||
ctx := context.Background()
|
||||
cs, err := nbs.persister.Open(ctx, storageId, 0, nbs.stats)
|
||||
if err == nil {
|
||||
defer cs.close()
|
||||
count, err := cs.count()
|
||||
if err == nil {
|
||||
return tableSpec{name: storageId, chunkCount: count}, true
|
||||
}
|
||||
}
|
||||
|
||||
return tableSpec{name: storageId, chunkCount: 0}, false
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ func TestGCConjoinsOldgen(t *testing.T) {
|
||||
for _, tc := range cases {
|
||||
tc := tc
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
// NOTE: avoid t.Parallel() here to keep dynamic ports simple.
|
||||
t.Parallel()
|
||||
var ports DynamicResources
|
||||
ports.global = &GlobalPorts
|
||||
ports.t = t
|
||||
|
||||
Reference in New Issue
Block a user