This Article explains a scenario when a mgd core might be seen when processing a commit operation.
labroot@lab_router> show system core-dumps
/var/crash/*core*: No such file or directory
-rw-rw---- 1 root field 45197205 Jan 24 07:42 /var/tmp/mgd.core.0.gz
Mgd core may be generated when a large change is commited due to unavibility of space in database to process the change commited as the disk is already full.
labroot@lab_router> show system configuration database usage
Maximum size of the database: 228.50 MB
Current database size on disk: 228.00 MB
Actual database usage: 227.98 MB
Available database space: 0.52 MB >>>>>>>> database space is almost full
This will be followed by the mgd core and size exceeds limit error messages.
Jan 24 07:39:49 lab_router mgd[97472]: UI_DBASE_EXTEND_FAILED: Unable to extend configuration database file '/var/run/db/juniper.db' to size 0xe480000 from 0xe480000: size exceeds limit
Jan 24 07:40:17 lab_router mgd[97472]: UI_DBASE_EXTEND_FAILED: Unable to extend configuration database file '/var/run/db/juniper.db' to size 0xe480000 from 0xe480000: size exceeds limit
Twe can try to resize the database with the below command however we might get the error as you can see below.
sadarla@lab_router> request system configuration database resize force
error: configuration database size limit exceeded
Reinitializing the mgd process helps to mitigate this issue as it significantly reduces the size of the configuration database.
Command to reinitialize the mgd:
> mgd -I
Before re-initializing the mgd:
root@device> show system configuration database usage Maximum size of the database: 665.99 MB Current database size on disk: 665.50 MB <<<<<<< Actual database usage: 665.16 MB Available database space: 0.84 MB
After re-initializing the mgd:
root@device> show system configuration database usage Maximum size of the database: 665.99 MB Current database size on disk: 2.50 MB <<<<<<< Actual database usage: 2.46 MB Available database space: 663.53 MB