[This is preliminary documentation and subject to change]

# Metabase History Scenario 1

This scenario illustrates how edit while running works under the following conditions:

- There are changes pending in the in-memory metabase.
- MetaBase.xml is not write-locked.
- MetaBase.xml is not read-only.
- MetaBase.xml is not newer than the temporary file.

You will learn:

- How IIS writes the in-memory metabase to disk when all checks pass.
- How history files are versioned and named when the in-memory metabase is written to disk.

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

IIS performs a series of verifications as seen below. Refer to 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. IIS determines the major version number.
4. IIS creates a temporary file containing the in-memory metabase configuration. Note: 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 with the major and minor version numbers.
7. IIS verifies if the MetaBase.xml file is write locked. <Passed Verification>
8. IIS verifies if the MetaBase.xml file is read-only. <Passed Verification>
9. IIS verifies if the MetaBase.xml file in newer than the temporary file. <Passed Verification>
10. Because the MetaBase.xml file is not write locked, not read-only, and is not newer than the temporary file, the temporary file is copied over MetaBase.xml, and the temporary file is deleted.
11. IIS checks to determine whether the number of history file pairs contained in the history folder exceed the value of the MaxHistoryFiles property. A history file pair is a MetaBase.xml and MBSchema.xml history file versioned with the same major and minor version numbers. If the number of history file pairs exceed the MaxHistoryFiles value, the oldest history file pair, based on the timestamp value, is deleted.

phrase 1, phrase 2, phrase 3

© 1997-2001 Microsoft Corporation. All rights reserved.