Pivotal Knowledge Base

Follow

Getting error: "Could not create and pre grow file in dir" when using disk store

Applies to

GemFire XD 1.3 - 1.4.1

Purpose

Describe why the error "Could not create and pre grow file in dir" is thrown when using a disk store and how to solve it

Issue

The following error is thrown when creating a table or other object in GemFire that uses a disk store:

ERROR X0Z33: SQLSTATE=X0Z33,SEVERITY=-1: (Server=test.pivotal.com[1531],Thread[DRDAConnThread_32,5,gemfirexd.daemons]) For DiskStore 'PROD_SENDER_DISKSTORE': Could not create and pre grow file in dir dir=/app/pivotal/gemfirexd/diskstores maxSpace=1073741824 usedSpace=0 availableSpace=1073741824 with size=1,073,741,824 
Caused by: SqlException: SQLSTATE=X0Z33,SEVERITY=-1: (Server=test.pivotal.com[1531],Thread[DRDAConnThread_32,5,gemfirexd.daemons]) For DiskStore 'PROD_SENDER_DISKSTORE': Could not create and pre grow file in dir dir=/app/pivotal/gemfirexd/diskstores maxSpace=1073741824 usedSpace=0 availableSpace=1073741824 with size=1,073,741,824 at com.pivotal.gemfirexd.internal.client.am.Statement.completeSqlca(Statement.java:2038)

This is after creating the disk store succesfully.

Solution

The root cause is related to the sizes configurED for the oplog size and the directory itself.
GemFire XD tries to allocate the configured size from scratch when initializing disk stores. So if configuring both MAXLOGSIZE and max directory size to the same value this error will be thrown as GemFire XD needs the space required by logging and other misc activity which is aprox. 20MB. These misc files includes disk store metadata (.if) and store access control (.lk) for example.

More information can be found here.

So to conclude the solution is to increase the max disk size by at least 20MB in comparison to the MAXLOGSIZE as follows:

CREATE DISKSTORE "GFXD-DEFAULT-PRST-DISKSTORE" MAXLOGSIZE 1024 AUTOCOMPACT TRUE ALLOWFORCECOMPACTION TRUE COMPACTIONTHRESHOLD 50 TIMEINTERVAL 1000 WRITEBUFFERSIZE 32768 QUEUESIZE 0 ('/path/to/diskstore' 1048);

Comments

Powered by Zendesk