Increase the space of an existing file using libpmem.
41 views
Skip to first unread message
Herold Christian
unread,
Jul 31, 2019, 7:17:52 AM7/31/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pmem
Is it possible to increase the space of an existing file?
Currently, I used ftruncate from POSIX. Is there a way with libpmem?
I have also another question:
Is it possible to increase the space of an mapped file?
Cheers,
Christian
Steve Scargall
unread,
Aug 1, 2019, 1:13:56 PM8/1/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pmem
Hi Christian,
It is currently not possible to grow an existing file/pool directly. You can achieve the desired result by creating a persistent memory pool consisting of one or more file parts. We call this a "pool set". See the poolset man page (http://pmem.io/pmdk/manpages/linux/v1.6/poolset/poolset.5). Also, see the heap.size.granularity and heap.size.extend CTL entry points here:
In this example, if your application was to open the "mypool.set" instead of the underlying pool file (memory-mapped file), you would get a 700GB pool. If you added another 100G file to mypool.set, it would grow to 800GB. All file parts can reside on the same file system or multiple file systems as shown above. Poolsets also allow for remote replication across nodes. For automatic growth of poolsets, review the DIRECTORIES section of the poolset(5) man page. If you're switching from a single pool/file to a poolset you'll need to restart the app.
HTH
Steve
Steve Scargall
unread,
Aug 1, 2019, 1:25:37 PM8/1/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pmem
Correction: You can grow a single file/pool using the *truncate command in Linux. There's an open feature request for "pmempool resize" that would assist in the simple cases (https://github.com/pmem/issues/issues/875)