JuliaData / JuliaData/MemPool.jl

`deleteat!` fails in `sra_migrate!`

Open
#77 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug storage
Dominant language
Julia
Stars
25
Forks
16
Avg merge
4h 56m
Merged PRs (30d)
1

Description

https://github.com/JuliaData/MemPool.jl/blob/8508088b32caff629ce6905cb263f78cdc068cd6/src/storage.jl#L963

The call to reverse above assumes to_delete is in ascending order, which isn't necessarily the case. I didn't thoroughly test, so I don't know what combinations of to_mem and sra.policy cause an error, but I got an error about trying to delete an index that didn't exist when using a LRU policy (don't know if to_mem was true or not). The problem did not occur when I switched to a MRU policy. Sorry I don't have a MWE, though I can reliably reproduce the issue.

My problem went away when I replaced reverse(to_delete) with sort(to_delete; rev = true).

Contributor guide

No contributing guide indexed for this repository

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

Start in src/storage.jl around line 963 and trace sra_migrate!, especially how to_delete is built and consumed for LRU and MRU policies with different to_mem values. Reproduce the invalid-index deletion, then verify that deletion order remains valid for the affected combinations and that the failure no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
39/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.