[This is preliminary documentation and subject to change]

# Metabase History Scenario 2

This scenario illustrates how the metabase history feature works under the following conditions:

- There are changes pending in the in-memory metabase.
- MetaBase.xml is write-locked.

What you will learn:

- How IIS behaves when the MetaBase.xml file is write-locked and the in-memory metabase is written to disk.

Action taken: A write-to-disk event occurs:

IIS performs a series of verifications. See Writing the Metabase to Disk for more information about the verifications.

1. IIS verifies that there are changes pending in the in-memory metabase.
2. IIS locks the in-memory metabase to prevent writes.
3. To determine the major version number, IIS looks within the in-memory metabase for the HistoryMajorVersionNumber value.
4. IIS creates a temporary file containing the in-memory metabase configuration, and the value of the HistoryMajorVersionNumber property that was determined in step 3 is written within the temporary file.
5. IIS unlocks the in-memory metabase to allow writes.
6. IIS copies the temporary file to the history folder and renames the file using the major and minor version numbers.
7. IIS verifies whether the MetaBase.xml file is write-locked. <Failed verification.>
8. Because the MetaBase.xml file is write-locked, the MetaBase.xml file is not overwritten with the temporary file and an error is sent to the event log.

Note This is the only situation in which the temporary file is not deleted by IIS. Along with the event log error, this can be valuable information to remember when troubleshooting.

A particular issue of concern regarding this scenario is when IIS is shut down and the MetaBase.xml file is write-locked. In this case, when IIS is restarted, the configuration that is copied into the in-memory metabase from the MetaBase.xml file does not contain the latest changes. To recover from this issue, you can compare the MetaBase.xml file with the latest history file to determine the changes that were made and then write the changes to MetaBase.xml or re-apply the changes to the in-memory metabase. This situation can be avoided by using a text editor, such Notepad, that does not write-lock files.

Related Topics

- For more information about starting IIS, see Starting IIS.
- For more information about stopping IIS, see Stopping IIS.

phrase 1, phrase 2, phrase 3

© 1997-2001 Microsoft Corporation. All rights reserved.