Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CountItems/CountManager.js

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No version bumps, we said we will release it with 4.3.0 and we have other ongoing prs opened

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we have other ongoing prs opened

other PRs target 1.18, so will not help deliver this in 4.3.0 : best to make the release already for 1.16 and 1.17 ?

Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ class CountManager {
}
});
this.q.resume();
if (this.q.idle()) {
this.log.info('no buckets to process, skipping count');
process.nextTick(onceCB);
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/CountItems/CountManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -983,8 +983,8 @@ describe('CountItems::CountManager', () => {
});
const bucketList = {
bucketCount: 10,
bucketInfos: Array(10)
.map(() => BucketInfo.deSerialize(testBucketMD)),
bucketInfos: Array(10).fill()
.map(() => BucketInfo.deSerialize(stringifiedBucketMD)),
};
m.addWork(bucketList);
const testCB = jest.fn();
Expand Down
6 changes: 3 additions & 3 deletions utils/S3UtilsMongoClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ class S3UtilsMongoClient extends MongoClientInterface {
targetCount = 'versionCount';
targetData = 'versionData';

if (entry.value.replicationInfo.backends.length > 0
if (entry.value.replicationInfo?.backends?.length > 0
&& this._isReplicationEntryStalled(entry, cmpDate)) {
stalledCount++;
}
Expand Down Expand Up @@ -511,7 +511,7 @@ class S3UtilsMongoClient extends MongoClientInterface {
};

// only count it in current dataStore if object is not in transient or replication not completed
if (!isTransient || entry.value.replicationInfo.status !== 'COMPLETED') {
if (!isTransient || entry.value.replicationInfo?.status !== 'COMPLETED') {
results.location[entry.value.dataStoreName] = size;
// We do not support restores to custom location yet. If we do,
// the destination would be present in the object metadata. For now,
Expand All @@ -523,7 +523,7 @@ class S3UtilsMongoClient extends MongoClientInterface {
results.location[bucketInfo.getLocationConstraint()] = size;
}
}
entry.value.replicationInfo.backends.forEach(rep => {
entry.value.replicationInfo?.backends?.forEach(rep => {
// count it in the replication destination location if replication compeleted
if (rep.status === 'COMPLETED') {
results.location[rep.site] = size;
Expand Down
Loading