pmem / pmdk

Persistent Memory Development Kit
https://pmem.io
Other
1.34k stars 510 forks source link

PMEM heap.size.extend could not cross directory boundary #5354

Closed kenhwang99 closed 1 year ago

kenhwang99 commented 2 years ago

ISSUE: PMEM heap size extend could not cross directory boundary

Environment Information

Please provide a reproduction of the bug:

Edit testpool.set as:

cat /root/testpool.set

PMEMPOOLSET OPTION SINGLEHDR 32G /mnt/pmem0 32G /mnt/pmem1 32G /mnt/pmem2 32G /mnt/pmem3 32G /mnt/pmem4 32G /mnt/pmem5 32G /mnt/pmem6 32G /mnt/pmem7 32G /mnt/pmem8 32G /mnt/pmem9 32G /mnt/pmem10 32G /mnt/pmem11 32G /mnt/pmem12 32G /mnt/pmem13 32G /mnt/pmem14 32G /mnt/pmem15

Create poolset:

pmempool create obj --layout two_lists /root/testpool.set

then list the directories: ]# ls -lh /mnt/pmem* /mnt/pmem0: total 8.0M -rw-rw-r--. 1 root root 8.0M Oct 25 14:21 000000.pmem

/mnt/pmem1: total 0

/mnt/pmem10: total 0

/mnt/pmem11: total 0

/mnt/pmem12: total 0

/mnt/pmem13: total 0

/mnt/pmem14: total 0

/mnt/pmem15: total 0

/mnt/pmem2: total 0

/mnt/pmem3: total 0

/mnt/pmem4: total 0

/mnt/pmem5: total 0

/mnt/pmem6: total 0

/mnt/pmem7: total 0

/mnt/pmem8: total 0

/mnt/pmem9: total 0

Modified pmdk example obj_ctl_heap_size.c to 1GB each time

define CUSTOM_GRANULARITY ((1 << 20) * 1024)

define OBJ_SIZE 1024 1024 128

and rename it to test_heap_ext.c and build test_heap_ext. Create a shell script test.sh:

cat test.sh

!/bin/bash

for i in {1..200} do echo "extend pool size at $i times" ./test_heap_ext /root/testpool.set x done

run test.sh and found it failed at and after 124 loop. Then checked and saw all the .pmem files are under /mnt/pmem1. The test script fill the directory and then failed. It did not use pmem0, pmem2 - pmem15. It did not extend across pmem1 directory boundary:

ls -lh /mnt/pmem*

/mnt/pmem0: total 8.0M -rw-rw-r--. 1 root root 8.0M Oct 25 14:28 000000.pmem

/mnt/pmem1: total 124G -rw-------. 1 root root 1.0G Oct 25 14:28 000001.pmem ... -rw-------. 1 root root 1.0G Oct 25 14:28 000122.pmem -rw-------. 1 root root 1.0G Oct 25 14:28 000123.pmem

/mnt/pmem10: total 0

/mnt/pmem11: total 0

/mnt/pmem12: total 0

/mnt/pmem13: total 0

/mnt/pmem14: total 0

/mnt/pmem15: total 0

/mnt/pmem2: total 0

/mnt/pmem3: total 0

/mnt/pmem4: total 0

/mnt/pmem5: total 0

/mnt/pmem6: total 0

/mnt/pmem7: total 0

/mnt/pmem8: total 0

/mnt/pmem9: total 0

How often bug is revealed: (always, often, rare): always

Actual behavior:

Expected behavior:

Expect it will cross directory boundaries and use out all the directory space (16 x 32G) I did try Pitor suggestion and found it work as expected: obj_open(); while (result == 0) { result = extend(); } obj_close(); It created .pmem files among all 16x directories as expected.

I consider doing obj_open(); extend(); obj_close(); in a loop could not cross directory a bug and ask for a fix. Thank you.

Details

Additional information about Priority and Help Requested:

Are you willing to submit a pull request with a proposed change? (Yes, No)

Requested priority: (Showstopper, High, Medium, Low)

grom72 commented 1 year ago

To be reproduced with libpmemobj.

janekmi commented 1 year ago

This improvement is not considered vital at the moment. So, we do not have the resources to fulfil your request. Sorry.