gtpd1m36Database Reference

Maintaining Data Consistency in a Cache System

Each time a connecting TPF system tries to read or write data, the interest of that TPF system is registered in that piece of shared data. It also indicates, in a local cache vector entry the TPF system specifies, that the copy of the piece of shared data is valid. A valid copy of data is one that contains the latest updates to that piece of shared data that other TPF systems might have made.

Registering interest allows the TPF system to remember that the local cache buffer contains a valid copy of the piece of shared data. If that piece of shared data is changed, the TPF system deregisters interest in that piece of shared data for the others and indicates in their local cache vector entry that the copy is no longer valid. Each connecting TPF system must ensure that the locally cached copy is valid by testing the vector entry associated with that piece of shared data. Each TPF system also needs to ensure that there is serialization of the data between the time the TPF system tests the validity of the piece of shared data and the time when the TPF system makes use of the data.

Registering Interest in a Piece of Shared Data and Validating Local Copies

When interest is registered, the TPF system must specify an entry in the local cache vector that has been assigned to that piece of shared data. The TPF system uses the vector entry to indicate that the associated piece of shared data in the local cache buffer is valid. Figure 64 shows a piece of shared data X in the local storage buffer of connecting user A. The piece of shared data is valid because vector entry 2 (the vector entry that connection A assigned to the shared piece of data X) indicates that the data is valid.

The TPF system keeps track of the validity of copies of the shared pieces of data, and the vector entries for each TPF system in the directory entry for each data item in the CF cache structure. In Figure 64, the directory for the shared piece of data Z shows that connecting users A and B have registered interest in Z; that is, the connections have valid copies of the shared piece of data Z. If a third connection updates Z in the CF cache structure, the TPF system uses the assigned vector entries (entry 5 for connection A and entry 4 for connection B) to invalidate the local copies belonging to connections A and B.

Figure 64. Registered Interest in Shared Pieces of Data


Deregistering Interest in a Shared Piece of Data and Invalidating Local Copies

Figure 65 shows what happens when connection A updates the shared piece of data Z. The TPF system invalidates the copy of Z belonging to connection B using local cache vector entry 4 (the vector entry that connection B assigned to Z). Notice also that the CF cache structure directory shows that only connection A has registered interest in Z; connection B has been deregistered.

Figure 65. Invalidating a Local Cache Copy of a Shared Piece of Data