The invention discloses a method and a device for maintaining the
data consistency of a
thin provisioning database. The method comprises the following steps: receiving a
data space revision instruction; according to the revision instruction, revising logical volume
space mapping information in a mapping tree, and revising a
metadata version number in a super block; and storing the
metadata version number in the super block, the revised logical volume
space mapping information and the type information of the revision instruction into a log space. Obviously, in the embodiment of the invention, when the logical volume
space mapping information in the mapping tree is revised according to the revision instruction, the
metadata version number in the super block, the revised logical volume space mapping information and the type information of the revision instruction are simultaneously backed up to the log space, data is recovered through backed up
log data in case the
system powers down, the problem of metadata and
data loss due to
system power failure can be solved, a log storage data size in the
storage pool is extremely small, and influence on
system performance is low.