Check and repair a folder with inconsistencies
#include <mme/mme.h>
int mme_sync_db_check( mme_hdl_t *hdl,
uint64_t folderid,
uint32_t flags );
- hdl
- An MME connection handle.
- folderid
- The ID of the folder to verify and repair.
- flags
- Flags controlling the verification and repair. See “Flags” below.
mme
The function mme_sync_db_check() checks the specified folder for consistency and, optionally, attempts to repair any errors it encounters. It:
- Checks folder information (in fields reserved for internal use only) in the folders table.
- Logs all inconsistencies.
- If the MME_SYNC_OPTION_REPAIR flag is set, attempts to repair any inconsistencies that it finds between the folder information in the database and the folder's contents.
The function mme_sync_db_check():
- can be used to try to repair inconsistencies:
- if problems are encountered after a synchronization
- for mediastores with POSIX compliant filesystems only; if the specified folder is not on a mediastore with a POSIX compliant filesystem (i.e. a CDDA), mme_sync_db_check() returns an error
- always verifies the consistency of the specified folder if it can
 |
If mme_sync_db_check() finds and is unable to repair inconsistencies between the MME database and a folder, there is probably a problem with the database that requires immediate attention. |
You should use mme_sync_db_check() if you suspect a problem with the MME database, and proceed as follows:
- Call mme_sync_db_check() to verify the folder that may be the source of the problem (do not set flags to MME_SYNC_OPTION_REPAIR). If the function reports zero inconsistencies, the database does not require repair.
- If mme_sync_db_check() reports and logs inconsistencies, call the function again with the flags option set to MME_SYNC_OPTION_REPAIR.
- After mme_sync_db_check() finishes repairing the database, run this function again, with the flags option not set to MME_SYNC_OPTION_REPAIR — you need to verify that the repair was completely successful.
- If mme_sync_db_check() still reports inconsistencies:
- Contact QNX and forward, if possible:
- all logs
- the database with the inconsistencies
- a copy of the mediastore associated with the inconsistencies; this copy must keep all file modification times from the original
- Restart and resynchronize the mediastore with the inconsistencies by calling mme_ms_restart() to delete all database contents associated with this mediastore.
- If resynchronization of an newly active mediastore is not automatic on your system, call mme_resync_mediastore() to synchronize the mediastore.
- If mme_sync_db_check() no longer reports inconsistencies, resynchronize the mediastore by calling mme_resync_mediastore().
The behavior of mme_sync_db_check() is determined by the values of the flags argument:
- MME_SYNC_OPTION_REPAIR (0x0400) — verify and attempt to repair the database
- MME_SYNC_OPTION_VERIFY (0x0800) — verification is the minimum action performed by mme_sync_db_check(), so this flag is always implied in any call to this function
- MME_SYNC_OPTION_RECURSIVE (0x4000) — verify and repair recursively (the specified folder and its subfolders)
None delivered.
This function checks that:
- the specified folder ID exists
- the specified folder is on an active mediastore
- there is a checking function
This function runs synchronously, and therefore blocks.
- 0
- Success: the verification or repair operation has started.
- -1
- An error occurred (errno is set).
QNX Neutrino
Safety: | |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |
MME_SYNC_OPTION_*