Get the App
SLTechnology News&Howtos  ›  Servers  › 

What is the use of resolve in MDCache

Shulou Source: shulou.com Published: 2022-05-31 18:12:24 10月03日 Update

This article mainly introduces what is the use of resolve in MDCache. It is very detailed and has a certain reference value. Interested friends must finish reading it!

The handle_resolve () function in MDCache handles MMDSResolve class messages. If the slave_requests array in the MMDSResolve class message is not empty, the array is processed first, and the saved data in the array is written to the uncommitted_masters array, the rejoin_slave_exports array, and the rejoin_imported_caps array. Finally, the MMDSResolveAck class message is created and the commit of the corresponding slave request is set, and finally the MMDSResolveAck class message is sent back to the corresponding MDS process. If MDS is in clientreplay/active/stopping state, you can get the directory of import currently in ambiguous state by traversing the my_ambiguous_imports array, and then look for the directory of import in ambiguous state under the subtrees directory in the MMDSResolve message. If you find it, execute the migrator- > import_finish () function to indicate that the import directory is complete. Iterate through the subtrees array in the MMDSResolve class message and call the try_subtree_merge () function to try to merge the subtree to MDS. Finally, iterate through the ambiguous_imports array of MMDSResolve class messages to update the other_ambiguous_imports array, and then call the mybe_resolve_finish () function to confirm that the resolve is complete.

The handle_resolve_ack () function in MDCache handles MMDSResolveAck class messages. First iterate through the commit array in the MMDSResolveAck class message, and delete the corresponding item from the ambiguous_slave_updates array if the elements in the array are in the ambiguous_slave_updates array. If MDS is in the Resolve state, the MDSlaveUpdate class object is obtained, then the MDSlaveUpdate class object is written to mdlog, and finally the corresponding item in the uncommitted_slave_update array is deleted. If the MDS is not in the Resolve state, the MDRequest class object is obtained, and finally the request_finish () function is called to complete the request request. Then iterate through the abort array in the MMDSResolveAck class message, and perform the appropriate rollback operation if the MDS is in the Resolve state, otherwise the request_finish () function is called to complete the request request.

The above is all the content of this article "what is the use of resolve in MDCache?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Arrays messages functions states directories objects processing content articles appropriateness value elements interests guys partners data more knowledge industry information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Apple MariaDB Docker vpn