)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"08bc6462ab4841206a63de5cf6bb75f31edbe8b8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"9444684f_f3e1d76a","updated":"2022-09-09 22:37:27.000000000","message":"Hi Kiran, thank you for the change..  i\u0027ve a question inline","commit_id":"7095d76e79aa348aa1c1031b8714f63dd06e28d0"},{"author":{"_account_id":29632,"name":"Carlos Eduardo","email":"ces.eduardo98@gmail.com","username":"silvacarlos"},"change_message_id":"e9b4aa6823e06a682e997636c69fd0fa0b1ec820","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"fbc9616e_c3637b82","updated":"2023-02-27 17:10:52.000000000","message":"recheck\nTrying to get some fresh logs","commit_id":"dc223696004e34177791a4f6dca1974d1864ff24"}],"manila/share/api.py":[{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"08bc6462ab4841206a63de5cf6bb75f31edbe8b8","unresolved":true,"context_lines":[{"line_number":851,"context_line":"    def promote_share_replica(self, context, share_replica):"},{"line_number":852,"context_line":""},{"line_number":853,"context_line":"        # Get the latest replica state from backend"},{"line_number":854,"context_line":"        self.share_rpcapi.update_share_replica(context, share_replica)"},{"line_number":855,"context_line":"        share_replica \u003d self.db.share_replica_get(context, share_replica[\u0027id\u0027])"},{"line_number":856,"context_line":"        if share_replica.get(\u0027status\u0027) !\u003d constants.STATUS_AVAILABLE:"},{"line_number":857,"context_line":"            msg \u003d _(\"Replica %(replica_id)s must be in %(status)s state to be \""},{"line_number":858,"context_line":"                    \"promoted.\")"},{"line_number":859,"context_line":"            raise exception.ReplicationException("}],"source_content_type":"text/x-python","patch_set":2,"id":"57fc5c3b_678a0f93","line":856,"range":{"start_line":854,"start_character":1,"end_line":856,"end_character":1},"updated":"2022-09-09 22:37:27.000000000","message":"We can\u0027t expect to get the updated state of the share replica right after we make the update request because of these processes being distributed and the communication being async. Can i understand the use case better here?\n\nIs this for planned failover?","commit_id":"7095d76e79aa348aa1c1031b8714f63dd06e28d0"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"153e8d24230f4d5624d20622a540490124763676","unresolved":true,"context_lines":[{"line_number":851,"context_line":"    def promote_share_replica(self, context, share_replica):"},{"line_number":852,"context_line":""},{"line_number":853,"context_line":"        # Get the latest replica state from backend"},{"line_number":854,"context_line":"        self.share_rpcapi.update_share_replica(context, share_replica)"},{"line_number":855,"context_line":"        share_replica \u003d self.db.share_replica_get(context, share_replica[\u0027id\u0027])"},{"line_number":856,"context_line":"        if share_replica.get(\u0027status\u0027) !\u003d constants.STATUS_AVAILABLE:"},{"line_number":857,"context_line":"            msg \u003d _(\"Replica %(replica_id)s must be in %(status)s state to be \""},{"line_number":858,"context_line":"                    \"promoted.\")"},{"line_number":859,"context_line":"            raise exception.ReplicationException("}],"source_content_type":"text/x-python","patch_set":2,"id":"7cbaa544_17a5bf9a","line":856,"range":{"start_line":854,"start_character":1,"end_line":856,"end_character":1},"in_reply_to":"57fc5c3b_678a0f93","updated":"2022-10-03 08:02:46.000000000","message":"In our cluster, we set \u0027replica_state_update_interval\u0027 to 10 min. While promoting replica(which report as in_sync from DB), we observed that they are actually out of sync. Since timer callback did not update state due to check of every 10 min, we are end up trying to promote the replica which is out of sync. This results in error. \nSo this step to update replica state before promotion and if out of sync, abort.","commit_id":"7095d76e79aa348aa1c1031b8714f63dd06e28d0"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"753deb6ae6c49c295ae8d2be01421f2954eaecb1","unresolved":true,"context_lines":[{"line_number":851,"context_line":"    def promote_share_replica(self, context, share_replica):"},{"line_number":852,"context_line":""},{"line_number":853,"context_line":"        # Get the latest replica state from backend"},{"line_number":854,"context_line":"        self.share_rpcapi.update_share_replica(context, share_replica)"},{"line_number":855,"context_line":"        share_replica \u003d self.db.share_replica_get(context, share_replica[\u0027id\u0027])"},{"line_number":856,"context_line":"        if share_replica.get(\u0027status\u0027) !\u003d constants.STATUS_AVAILABLE:"},{"line_number":857,"context_line":"            msg \u003d _(\"Replica %(replica_id)s must be in %(status)s state to be \""},{"line_number":858,"context_line":"                    \"promoted.\")"},{"line_number":859,"context_line":"            raise exception.ReplicationException("}],"source_content_type":"text/x-python","patch_set":2,"id":"e40d3f27_b76db938","line":856,"range":{"start_line":854,"start_character":1,"end_line":856,"end_character":1},"in_reply_to":"7cbaa544_17a5bf9a","updated":"2022-10-04 08:10:12.000000000","message":"\u003eFor planned failovers, wouldn\u0027t \"resync\" [1] make sense to be issued prior to promotion? (It\u0027s RBAC is set to \"role:admin\" by default, but can be overridden) \n\nYes, this is what I am doing implicitly and instead user/admin to issue resync, we try to resync first before promote in promote_replica API. What if I make this optional with new parameter --fetch-backend-state.\n1. by default option is false, so there is no change in existing behaviour.\n2. User can set this to true such that \nif (fetch-backend-state) {\n        self.share_rpcapi.update_share_replica(context, share_replica)\n        share_replica \u003d self.db.share_replica_get(context, share_replica[\u0027id\u0027])\n}\nif share_replica.get(\u0027status\u0027) !\u003d constants.STATUS_AVAILABLE:\n...\n...\n\n\nWDYT ?","commit_id":"7095d76e79aa348aa1c1031b8714f63dd06e28d0"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"b00f61b3391b055ed692404fbe00aa5330dc13a9","unresolved":true,"context_lines":[{"line_number":851,"context_line":"    def promote_share_replica(self, context, share_replica):"},{"line_number":852,"context_line":""},{"line_number":853,"context_line":"        # Get the latest replica state from backend"},{"line_number":854,"context_line":"        self.share_rpcapi.update_share_replica(context, share_replica)"},{"line_number":855,"context_line":"        share_replica \u003d self.db.share_replica_get(context, share_replica[\u0027id\u0027])"},{"line_number":856,"context_line":"        if share_replica.get(\u0027status\u0027) !\u003d constants.STATUS_AVAILABLE:"},{"line_number":857,"context_line":"            msg \u003d _(\"Replica %(replica_id)s must be in %(status)s state to be \""},{"line_number":858,"context_line":"                    \"promoted.\")"},{"line_number":859,"context_line":"            raise exception.ReplicationException("}],"source_content_type":"text/x-python","patch_set":2,"id":"2037f207_c9cdfda3","line":856,"range":{"start_line":854,"start_character":1,"end_line":856,"end_character":1},"in_reply_to":"7cbaa544_17a5bf9a","updated":"2022-10-03 20:11:06.000000000","message":"Oh, is this a timing issue then? The user attempts to \"promote\" a replica, but before the operation is completed, the replica has been updated to \"out_of_sync\" in the share manager? \n\nFor planned failovers, wouldn\u0027t \"resync\" [1] make sense to be issued prior to promotion? (It\u0027s RBAC is set to \"role:admin\" by default, but can be overridden) \n\nIf you\u0027re using the NetApp driver, it attempts to update prior to promotion too: https://github.com/openstack/manila/blob/6e8ed59a91934096a4ddc9b184ef50a633cbd1ec/manila/share/drivers/netapp/dataontap/cluster_mode/lib_base.py#L2860-L2866\n\n\n[1] https://docs.openstack.org/api-ref/shared-file-system/#resync-share-replica","commit_id":"7095d76e79aa348aa1c1031b8714f63dd06e28d0"},{"author":{"_account_id":33038,"name":"Chuan Miao","email":"chuan137@gmail.com","username":"chuan137"},"change_message_id":"71e6cde9f984ae0c561da5ed15b554d783a4fd23","unresolved":false,"context_lines":[{"line_number":851,"context_line":"    def promote_share_replica(self, context, share_replica):"},{"line_number":852,"context_line":""},{"line_number":853,"context_line":"        # Get the latest replica state from backend"},{"line_number":854,"context_line":"        self.share_rpcapi.update_share_replica(context, share_replica)"},{"line_number":855,"context_line":"        share_replica \u003d self.db.share_replica_get(context, share_replica[\u0027id\u0027])"},{"line_number":856,"context_line":"        if share_replica.get(\u0027status\u0027) !\u003d constants.STATUS_AVAILABLE:"},{"line_number":857,"context_line":"            msg \u003d _(\"Replica %(replica_id)s must be in %(status)s state to be \""},{"line_number":858,"context_line":"                    \"promoted.\")"},{"line_number":859,"context_line":"            raise exception.ReplicationException("}],"source_content_type":"text/x-python","patch_set":2,"id":"a63c0f4a_3ffd2206","line":856,"range":{"start_line":854,"start_character":1,"end_line":856,"end_character":1},"in_reply_to":"82a2cc15_f1d8016d","updated":"2022-10-19 11:30:13.000000000","message":"Hi Goutham,\n\nNot a timing issue. The replica state is read periodically by Manila, but there might be replication activity on the backend in the meanwhile, and the replica state could be not up to date. For instance large chunk of data is written on the source side, and backend could take a while replicating the data to target. When user issue a promote command, it\u0027s not guaranteed that the replication activity is done. If promotion were allowed without checking, it could leads to data lost.\n\nBest regards,\nChuan","commit_id":"7095d76e79aa348aa1c1031b8714f63dd06e28d0"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"4d00aee89f0600063f6b15cb87f78c04949e5fa4","unresolved":false,"context_lines":[{"line_number":851,"context_line":"    def promote_share_replica(self, context, share_replica):"},{"line_number":852,"context_line":""},{"line_number":853,"context_line":"        # Get the latest replica state from backend"},{"line_number":854,"context_line":"        self.share_rpcapi.update_share_replica(context, share_replica)"},{"line_number":855,"context_line":"        share_replica \u003d self.db.share_replica_get(context, share_replica[\u0027id\u0027])"},{"line_number":856,"context_line":"        if share_replica.get(\u0027status\u0027) !\u003d constants.STATUS_AVAILABLE:"},{"line_number":857,"context_line":"            msg \u003d _(\"Replica %(replica_id)s must be in %(status)s state to be \""},{"line_number":858,"context_line":"                    \"promoted.\")"},{"line_number":859,"context_line":"            raise exception.ReplicationException("}],"source_content_type":"text/x-python","patch_set":2,"id":"82a2cc15_f1d8016d","line":856,"range":{"start_line":854,"start_character":1,"end_line":856,"end_character":1},"in_reply_to":"b859125d_dfa93437","updated":"2022-10-10 23:17:50.000000000","message":"I\u0027m not sure i understand the question... (is there one?) Perhaps help me understand the problem you\u0027re addressing by answering this:\n\n\nIs this a timing issue? Could the sequence be: \n\nThe user attempts to \"promote\" an in-sync replica, but before the operation is completed through the share manager, the replica goes stale, i.e, the periodic timer to get the replica\u0027s state realizes the replica is stale and updates the replica_state to \"out_of_sync\". Do i understand this correctly?","commit_id":"7095d76e79aa348aa1c1031b8714f63dd06e28d0"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"cb665860e1adedd7b03272dfb8d6bc3d94b883c1","unresolved":false,"context_lines":[{"line_number":851,"context_line":"    def promote_share_replica(self, context, share_replica):"},{"line_number":852,"context_line":""},{"line_number":853,"context_line":"        # Get the latest replica state from backend"},{"line_number":854,"context_line":"        self.share_rpcapi.update_share_replica(context, share_replica)"},{"line_number":855,"context_line":"        share_replica \u003d self.db.share_replica_get(context, share_replica[\u0027id\u0027])"},{"line_number":856,"context_line":"        if share_replica.get(\u0027status\u0027) !\u003d constants.STATUS_AVAILABLE:"},{"line_number":857,"context_line":"            msg \u003d _(\"Replica %(replica_id)s must be in %(status)s state to be \""},{"line_number":858,"context_line":"                    \"promoted.\")"},{"line_number":859,"context_line":"            raise exception.ReplicationException("}],"source_content_type":"text/x-python","patch_set":2,"id":"f05ebbab_857ba25f","line":856,"range":{"start_line":854,"start_character":1,"end_line":856,"end_character":1},"in_reply_to":"e40d3f27_b76db938","updated":"2022-10-04 08:18:23.000000000","message":"Done","commit_id":"7095d76e79aa348aa1c1031b8714f63dd06e28d0"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"2ab7341cf657a2f1bf21c52114421a3a659cdbe8","unresolved":false,"context_lines":[{"line_number":851,"context_line":"    def promote_share_replica(self, context, share_replica):"},{"line_number":852,"context_line":""},{"line_number":853,"context_line":"        # Get the latest replica state from backend"},{"line_number":854,"context_line":"        self.share_rpcapi.update_share_replica(context, share_replica)"},{"line_number":855,"context_line":"        share_replica \u003d self.db.share_replica_get(context, share_replica[\u0027id\u0027])"},{"line_number":856,"context_line":"        if share_replica.get(\u0027status\u0027) !\u003d constants.STATUS_AVAILABLE:"},{"line_number":857,"context_line":"            msg \u003d _(\"Replica %(replica_id)s must be in %(status)s state to be \""},{"line_number":858,"context_line":"                    \"promoted.\")"},{"line_number":859,"context_line":"            raise exception.ReplicationException("}],"source_content_type":"text/x-python","patch_set":2,"id":"fc5003ce_66ff6d65","line":856,"range":{"start_line":854,"start_character":1,"end_line":856,"end_character":1},"in_reply_to":"f05ebbab_857ba25f","updated":"2022-10-06 19:56:24.000000000","message":"I don\u0027t think making an API change is the way to go here -- simply because once you trigger an update, you\u0027ll need to wait for the update to be completed.\n\nOne possible solution is to try this update via the share manager just prior to promotion, especially if an \"out_of_sync\" status change has occurred...","commit_id":"7095d76e79aa348aa1c1031b8714f63dd06e28d0"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"2a9cab8a7ddb0308fa86b04b6098ec6c4c620313","unresolved":false,"context_lines":[{"line_number":851,"context_line":"    def promote_share_replica(self, context, share_replica):"},{"line_number":852,"context_line":""},{"line_number":853,"context_line":"        # Get the latest replica state from backend"},{"line_number":854,"context_line":"        self.share_rpcapi.update_share_replica(context, share_replica)"},{"line_number":855,"context_line":"        share_replica \u003d self.db.share_replica_get(context, share_replica[\u0027id\u0027])"},{"line_number":856,"context_line":"        if share_replica.get(\u0027status\u0027) !\u003d constants.STATUS_AVAILABLE:"},{"line_number":857,"context_line":"            msg \u003d _(\"Replica %(replica_id)s must be in %(status)s state to be \""},{"line_number":858,"context_line":"                    \"promoted.\")"},{"line_number":859,"context_line":"            raise exception.ReplicationException("}],"source_content_type":"text/x-python","patch_set":2,"id":"b859125d_dfa93437","line":856,"range":{"start_line":854,"start_character":1,"end_line":856,"end_character":1},"in_reply_to":"fc5003ce_66ff6d65","updated":"2022-10-09 13:11:56.000000000","message":"I am not sure how \u0027out_of_sync\u0027 status change occurrence can be retrieved except DB. So it must be issue update everytime and then read state from DB before promotion.","commit_id":"7095d76e79aa348aa1c1031b8714f63dd06e28d0"}]}
