Cache index file Expansion and file repair

Index File Expansion

When the following message appears in the /usr/local/oredge-node/logs/error.log error log, it indicates that the required size of the cache index file has exceeded the currently configured value:

"cache index database is full: MDB_MAP_FULL: Environment mapsize limit reached, considering raising the map size?"

This issue does not affect data forwarding but impacts the HTTP cache purge functionality. In such cases, we must expand the cache index file according to requirements.

Expansion Steps

  1. Modify the /usr/local/oredge-node/conf/nginx.conf configuration:
cache_index_map_size 1024m;

Adjust the size to the required value, for example, 1024m (1GB).

  1. Modify the /usr/local/oredge-node/conf/config.ini configuration file, adding the following content:
  [cache]
  lmdb_size = 1024m

Ensure that this size matches the value in nginx.conf.

Note: If you use an OpenResty Edge version lower than 23.6.1, please configure this in /usr/local/oredge-node/conf/or-config.ini. Also, please notify us so we can update your configuration package to prevent future upgrades from reverting your changes.

  1. Restart OpenResty Edge Node:
  systemctl start upgrade-oredge-node
  1. Verify if the configuration has taken effect:
  ls -lh /usr/local/oredge-node/data/cache_index.lmdb

If the displayed size matches the configured size (e.g., 1GB), the configuration has been applied successfully.

Index File Repair

When the following message appears in the /usr/local/oredge-node/logs/error.log error log, it indicates that the index file is corrupted:

"cache index unable to seek cursor: MDB_CORRUPTED: Located page was wrong type"

In this case, the index file needs to be deleted. Please note that deleting the index file will make the cache purge function for cached files ineffective.

This issue is usually caused by unexpected shutdowns (such as sudden power outages) preventing index file data from synchronizing to disk.

Delete Index File and Restart OpenResty Edge Node

  1. Delete the old index file:
  sudo rm -fr /usr/local/oredge-node/data/cache_index.lmdb/*
  1. Restart OpenResty Edge Node:
  systemctl start upgrade-oredge-node

By following these steps, you can effectively expand the cache index file and repair related issues, ensuring the regular operation of OpenResty Edge Node.