No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

OceanStor 9000 V300R005C00 File System Feature Guide 11

Rate and give feedback :
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Working Principle

Working Principle

This section describes how to create a snapshot, how to write data to and read data from a snapshot, and how to roll back a snapshot.

In a file system of the OceanStor 9000, each file consists of metadata and data and each directory contains only metadata:

  • Metadata: Metadata defines data properties and includes dentries and index nodes (inodes). Dentries contain information about file names, parent directories, and subdirectories and associate file names with inodes. Inodes contain file size, creation time, access time, permissions, block locations, and other information.
  • Data: From the perspective of files, data is the contents in files. The OceanStor 9000 divides data into stripes.

Figure 5-1 illustrates data structure of a file system.

Figure 5-1  Data structure of a file system

Concepts

  • Copy On Write (COW)

    COW is a snapshot technique that copies data objects protected by a snapshot to other locations before replacing these data objects with new data, so that the original data objects serve as snapshot data.

    OceanStor 9000 implements COW for metadata because: 1. One read operation and two write operations need to be performed during the COW process. 2. A few write operations but many read operations need to be performed on metadata. 3. Metadata occupies small space.

  • Redirect On Write (ROW)

    ROW is a snapshot technique that writes new data to new locations, instead of replacing the original data protected by a snapshot.

    The OceanStor 9000 implements ROW for data. The amount of data is typically large. Therefore, ROW helps minimize the impact on system performance.

NOTE:

OceanStor 9000 assigns different versions for snapshots created at different points in time for management.

Metadata COW

Metadata COW is a technique that copies the inode and dentry of a file or directory after a snapshot is created for source metadata and then modifies the source metadata after the snapshot version is generated. If a snapshot version exists, subsequent changes are directly made to the modified metadata in the original locations of the file without implementing COW again. If another snapshot version is created later, COW is implemented when metadata is changed for the first time.

Table 5-3 describes metadata modification scenarios.

Table 5-3  Metadata modification scenarios

Scenario

Description

Creating a file (including the soft link) or directory

Only the snapshot version of the parent directory is generated.

Deleting a file (including the soft link) or directory

The snapshot versions of the parent directory and deleted file or directory are generated.

Modifying properties

Only the snapshot version of the current directory or file is generated.

Renaming a file or directory

If a subdirectory or file in a directory protected by a snapshot is renamed and the snapshot version has been generated for the parent directory, only the snapshot version of the subdirectory or file is generated. If a subdirectory or file in a directory protected by a snapshot is renamed and no snapshot version has been generated for the parent directory, the snapshot versions of the subdirectory or file and parent directory are generated.

Based on the data structures shown in Figure 5-1, Figure 5-2 illustrates the metadata COW process where one directory is deleted.

Figure 5-2  Metadata COW implemented when a directory is deleted

Data ROW

After a snapshot is created, data ROW enables new data to be written to new objects instead of the original objects.

Based on the data structures shown in Figure 5-1, Figure 5-3 illustrates the data ROW process.

Figure 5-3  Data ROW

Reading Snapshot Data

From the perspective of a file system, a snapshot is required to store data and metadata of a file. Based on the minimal overhead principle, snapshots record changed contents and share unchanged contents. That is, different snapshots share data and snapshots and the current data also share data.

Based on snapshots, objects of data have a forward dependence relationship. Therefore, in the event of reading snapshot data, the system determines from which object data will be read based on the dependence relationship.

Figure 5-4  Reading data

As shown in Figure 5-4:

  1. When no snapshot is created for a file, data is written to object V.0. New data is directly written to object V.0.
  2. After snapshot 10 is created and data is not changed, data is read from and written to object V.10. By default, when no data is written to a data stripe, the data stripe depends forward and points to object V.0.
  3. After snapshot 10 is created and data changes, changed data (stripe 3, stripe 4, and stripe 5) is written to object V.10 and unchanged data (stripe 1 and stripe 2) is read from object V.0 based on the forward dependence relationship.
  4. After snapshot 20 is created and data is not changed, data is read from object V.20 based on the forward dependence relationship.
  5. After snapshot 20 is created and data changes, changed data (stripe 1, stripe 3, and stripe 5) is written to object V.20. Unchanged data stripe 2 and stripe 4 are read from object V.0 and object V.10, respectively.

Deleting a Snapshot

Deleting a snapshot means deleting snapshot metadata and data generated at a specific point in time. Only the unique data of the snapshot version is deleted.

Figure 5-5  Deleting snapshot data
As shown in Figure 5-5, deleting snapshot20 is used as an example.
  1. The current file has snapshot10 and snapshot20. File data is read from the current object (V.20).
  2. Delete snapshot20. Stripe3@snap20 and Stripe5@snap20 are unique data of snapshot20 and thus need to be deleted. The current file complies with the forward dependency relationship and reads data from object V.10, so Strip4 is retained. Other unchanged data continues to comply with the forward dependency relationship and data is read from object V.0.

Rolling Back a Snapshot

Snapshot rollback restores the current data to snapshot data at a specific point in time.

The snapshot rollback function of InfoStamper applies only to the InfoReplicator feature and supports only rollback to the latest snapshot. If data needs to rolled back to a non-latest snapshot, snapshot generated after the snapshot must be deleted before the rollback.

Figure 5-6  Snapshot data rollback

Figure 5-6 illustrates how to delete snapshot 20 and roll back file data to snapshot 10.

  1. Snapshot 10 and snapshot 20 have been created. Read the file data from object V.20.
  2. Delete snapshot 20 and roll back to snapshot 10. Copy the data on snapshot 10 (V.0) to overwrite object V.20. Read unchanged data from object V.0 based on the forward dependence relationship.
NOTE:

User data can be rolled back using Windows Volume Shadow Copy Service (VSS) or Shadow Copy, or recovered by manually copying snapshot data.

Translation
Download
Updated: 2019-03-30

Document ID: EDOC1000101823

Views: 19378

Downloads: 99

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next