SciCatProject / SciCatProject/backend

Updating number of files/size of dataset when creating datablocks leads to double counting

Open
#2,250 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
27
Forks
37
Avg merge
17h 32m
Merged PRs (30d)
38

Description

Summary

When creating origDatablocks, the dataset's size and numberOfFiles are updated (code).
The dataset's size / number of files should be the sum of its origDataBlocks files - this part works as expected.

During archiving,datablocks are created. However, the dataset size is updated again (code). This leads to double counting the number of files and false increase in size.

Steps to Reproduce

Current Behaviour

Expected Behaviour

Only update packedSize and numberOfFiles archived while creating datablocks

Details

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read src/datasets/datasets.controller.ts around lines 2091 and 2372, comparing the dataset updates made when creating origDatablocks and datablocks. Verify the archive path's accounting against the existing origDataBlocks totals. Done means archiving updates only packedSize and the number of archived files, without increasing the dataset's total size or numberOfFiles twice.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.