Skip to content

Quota related issues #1748

Closed
Closed

Description

@ihsaan-ullah

TODOS:

For more details check the comments section of this PR: #1738

Activity

  1. added
    Enhancement
    on Feb 10, 2025
  2. ObadaS commented on Feb 11, 2025

    @ObadaS
    Collaborator

    Concerning the Quota units, the unit in the Django Admin Interface is in bits (or bytes not sure), making it hard to know how much quota is actually assigned at a quick glance

    Image

  3. Didayolo commented on Feb 11, 2025

    @Didayolo
    Member

    NaN values for size on production server for old files (older than ~30 days)

    Image
  4. added
    P1
    on Feb 11, 2025
  5. ihsaan-ullah commented on Feb 11, 2025

    @ihsaan-ullah
    CollaboratorAuthor

    check format_file_size function in src/static/riot/submissions/resource_submissions.tag

    Edit:

    No need to check this for NA size. The problem is explained below in comments

  6. ihsaan-ullah commented on Feb 12, 2025

    @ihsaan-ullah
    CollaboratorAuthor

    @ObadaS I read somewhere that minio files meta-data can expire and file_size is a metadata that may be affected if there is an expiry role. If this is true then this maybe the cause of NAN size

    Edit:

    This was not the problem. The problem is explained in the comments below

  7. ObadaS commented on Feb 12, 2025

    @ObadaS
    Collaborator

    Interesting, I will check that tomorrow.
    However, there is no NaN size problem on the codabench-test website, which is connected to another MinIO that might have a different configuration.

    Codalab.lisn.upsaclay.fr also shows dataset size and does not seem to be impacted by the bug, even though they are both connected to the same MinIO, which could point to either a bucket problem on MinIO or a problem in the code of the plateform

  8. ihsaan-ullah commented on Feb 12, 2025

    @ihsaan-ullah
    CollaboratorAuthor

    The only problem right now is reproducibility. If we can reproduce the bug locally then solving it will not be a problem.

    I am pretty much convinced that there is no problem in the code because we see sizes for some files but I will investigate the code a bit more to be sure

  9. ihsaan-ullah commented on Feb 14, 2025

    @ihsaan-ullah
    CollaboratorAuthor

    We found that the file sizes are emptied by reset_computed_storage_analytics function. Rerunning storage analytics should fix the NA sizes

  10. Didayolo commented on Feb 14, 2025

    @Didayolo
    Member

    We found that the file sizes are emptied by reset_computed_storage_analytics function. Rerunning storage analytics should fix the NA sizes

    I started the storage analytics on production.

    What starts the reset_computed_storage_analytics in the first place?

  11. ihsaan-ullah commented on Feb 18, 2025

    @ihsaan-ullah
    CollaboratorAuthor

    I confirmed using this code that accessing file size from minio takes longer than accessing the file_size from DB. We can run it on codabench-test to be sure.

    Accessing from DB

    import time
    from datasets.models import Data
    
    start_time = time.time()
    sizes = sum(item.file_size for item in Data.objects.all())  
    end_time = time.time()
    
    execution_time = end_time - start_time
    print(f"Execution Time: {execution_time:.4f} seconds")

    Accessing from Minio

    import time
    from datasets.models import Data
    
    start_time = time.time()
    sizes = sum(item.data_file.size for item in Data.objects.all())  
    end_time = time.time()
    
    execution_time = end_time - start_time
    print(f"Execution Time: {execution_time:.4f} seconds")
  12. Didayolo commented on Feb 18, 2025

    @Didayolo
    Member

    We need to separate the computing of the file sizes from the analytics task:

    def create_storage_analytics_snapshot():

        # Measure all files with unset size
        for dataset in Data.objects.filter(Q(file_size__isnull=True) | Q(file_size__lt=0)):
            try:
                dataset.file_size = Decimal(
                    dataset.data_file.size / 1024
                )  # file_size is in KiB
            except Exception:
                dataset.file_size = Decimal(-1)
            finally:
                dataset.save()
  13. Didayolo commented on Feb 18, 2025

    @Didayolo
    Member

    New version of the script to compute file sizes:

    from datasets.models import Data
    from decimal import Decimal
    
    print("Total objects: ", Data.objects.all().count())
    
    datasets = Data.objects.all().order_by("id")
    print("Processing now: ", datasets.count())
    
    for dataset in datasets:
        if dataset.data_file and hasattr(dataset.data_file, 'size'):
            try:
                file_size = dataset.data_file.size
                if file_size <= 0 or file_size is None:
                    file_size = Decimal(0)
                else:
                    file_size = Decimal(file_size) / 1024
                dataset.file_size = file_size
                dataset.save()
            except Exception as e:
                print(f"Skipping dataset ID {dataset.id}: Invalid file size ({dataset.data_file.size}) - Error: {e}")
        else:
            print(f"File size problem, Data ID {dataset.id}")
  14. Didayolo commented on Feb 19, 2025

    @Didayolo
    Member

    The file sizes are back on production.

  15. ihsaan-ullah commented on Feb 20, 2025

    @ihsaan-ullah
    CollaboratorAuthor
  16. Didayolo commented on Feb 20, 2025

    @Didayolo
    Member

    List of data files that failed:
    Errors.txt

  17. removed
    P1
    on Apr 15, 2025
  18. Didayolo commented on Apr 15, 2025

    @Didayolo
    Member

    @ihsaan-ullah Can we close this issue?

  19. Didayolo commented on Apr 24, 2025

    @Didayolo
    Member

    I close this issue to keep track only on #1833

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugEnhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions