)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"1f2c4d969928ecf4b4820332f03ee610ea9861c4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"2083b502_3ed50877","updated":"2022-09-27 00:13:54.000000000","message":"Thanks - Apart from losing the create-if-not-exists optimization, it feels like this should be okay. Could you please add a release note?","commit_id":"50caf83eaf6b0e61e26729982e3e21c784272ec6"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"87edf5b930fbe2075e1030ca0376b7f1f9da4e43","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"de8b9432_614a6aa5","in_reply_to":"2083b502_3ed50877","updated":"2022-09-27 12:38:33.000000000","message":"Added release notes.","commit_id":"50caf83eaf6b0e61e26729982e3e21c784272ec6"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"37a42cd993ea8030a8ce2e68a2c6cd0bbbd29fb7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"a28ecde3_2dc2e8e3","updated":"2022-12-11 07:26:40.000000000","message":"please take a look my comment.","commit_id":"045750520af28a861141bcc47d25824b9823bcf3"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"64d65b16e4a2e8f36151d4993751ce77c2f92d9d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"d5cb762b_565f11f8","updated":"2022-11-23 15:40:41.000000000","message":"recheck","commit_id":"045750520af28a861141bcc47d25824b9823bcf3"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"7dc79c16ed1ceb524607659471c01096b2bde8d2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"9d78a706_b71afa82","updated":"2023-01-17 08:31:09.000000000","message":"thanks for your change.","commit_id":"2fc7bf51238a342eb5863f0dab2ab551b1c8263d"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"856975a5615e0d1e1b79386014954a0c2c1ce3ed","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"0b77065b_0fa50a0e","updated":"2023-02-14 01:01:48.000000000","message":"LGTM, lest\u0027s wait other reviewer.","commit_id":"f749d283f0f639ac9856bb4e539406d32d132908"},{"author":{"_account_id":29632,"name":"Carlos Eduardo","email":"ces.eduardo98@gmail.com","username":"silvacarlos"},"change_message_id":"2f2c37fc21080e8df8518426710d0bd746c93809","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"956be312_0ad57adf","updated":"2023-02-16 14:02:42.000000000","message":"Please add a test to migrations_data_checks.py as well","commit_id":"f749d283f0f639ac9856bb4e539406d32d132908"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"9ce3b7ba3712cff6705cb653b47de63756429095","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"ac7ee3cf_41247516","updated":"2023-02-16 06:53:16.000000000","message":"great work so far. I like the solution and think it can work; just a few questions inline.. ","commit_id":"f749d283f0f639ac9856bb4e539406d32d132908"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"e80c81b2162991a98270686e29055a18e987bb80","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"43c02707_b524c21f","in_reply_to":"0b77065b_0fa50a0e","updated":"2023-02-14 01:02:39.000000000","message":"let\u0027s","commit_id":"f749d283f0f639ac9856bb4e539406d32d132908"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"6bad53ab2d8af5e6107e4a7b1233ccf61c32bda5","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"1f6493fa_5311dee3","in_reply_to":"956be312_0ad57adf","updated":"2023-02-20 10:54:43.000000000","message":"Done","commit_id":"f749d283f0f639ac9856bb4e539406d32d132908"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"b6dbf260e7e9a629ff4ab5f097ae8134d9ae1514","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"5959aa97_3aa01f7a","updated":"2023-02-20 21:25:09.000000000","message":"Thanks; the DB method being used seems to be the wrong one","commit_id":"e59bb03b18be5301894176f4bfd97d40cfa95be7"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"d19cedc257151647062a03102b2813eb451e85b6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":15,"id":"ba7cca5f_c95cfb3b","updated":"2023-02-22 18:35:26.000000000","message":"Thanks for rebasing; please address the incorrect db query issue","commit_id":"961953370996c2767a15b7c30eb79a8b21c61bad"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"8bfd3225a5efb0a7624b7927e38625d3f7dc7597","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":15,"id":"e58d85d5_bde26115","in_reply_to":"b39a6bf2_abbffa58","updated":"2023-02-23 22:03:07.000000000","message":"How? you haven\u0027t changed the query - i\u0027m guessing we\u0027re talking past each other because i\u0027m confused at this point why we can\u0027t use a query that gets us services filtered by the specific topic. Anyway, it\u0027s not a big deal and can come as an enhancement.","commit_id":"961953370996c2767a15b7c30eb79a8b21c61bad"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"75cee5c66f51e9ead5c694695f5401dacbd7dcd6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":15,"id":"b39a6bf2_abbffa58","in_reply_to":"ba7cca5f_c95cfb3b","updated":"2023-02-23 14:28:06.000000000","message":"fixed","commit_id":"961953370996c2767a15b7c30eb79a8b21c61bad"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"947c8c9679f71fc4b7a7b4d38663b7d4e7fe31ec","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":16,"id":"6fca5ea7_e7843288","updated":"2023-02-23 06:23:02.000000000","message":"recheck","commit_id":"6d5ddce8b23393fe3c05f1a003e0aac5e8db290f"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"8bfd3225a5efb0a7624b7927e38625d3f7dc7597","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"de7d4112_5223af5c","updated":"2023-02-23 22:03:07.000000000","message":"Hey Kiran, Thanks for the changes. ","commit_id":"98be6376b2ec74343e0b51eab4e5f36927cfc88e"},{"author":{"_account_id":29632,"name":"Carlos Eduardo","email":"ces.eduardo98@gmail.com","username":"silvacarlos"},"change_message_id":"776b390e0d0f3c9cb8b4a2c81c863586b0abea4d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"c3f428e0_8d9292b5","updated":"2023-02-24 02:05:35.000000000","message":"Thanks for working on this change, Kiran. Please fix the code with the suggestions in a follow-up change.","commit_id":"98be6376b2ec74343e0b51eab4e5f36927cfc88e"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"85f9c3a2451ea42e8c55d815797a06700c314b72","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"56e45d75_19d0c24c","updated":"2023-02-24 06:41:11.000000000","message":"recheck\n\njob passed in check queue","commit_id":"98be6376b2ec74343e0b51eab4e5f36927cfc88e"},{"author":{"_account_id":29632,"name":"Carlos Eduardo","email":"ces.eduardo98@gmail.com","username":"silvacarlos"},"change_message_id":"e5a1f46f67cdd6bb812687f702e8f3b00d17784a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"d384adbf_6de42d5f","updated":"2023-02-24 17:26:54.000000000","message":"recheck\nBad luck with known issue again. Let\u0027s give it another shot","commit_id":"98be6376b2ec74343e0b51eab4e5f36927cfc88e"},{"author":{"_account_id":29632,"name":"Carlos Eduardo","email":"ces.eduardo98@gmail.com","username":"silvacarlos"},"change_message_id":"b4d1e2546a8c575932befc5cb3aba620388306f6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"d14223eb_438092bc","updated":"2023-02-24 13:28:33.000000000","message":"recheck\nKnown issue with the LVM driver","commit_id":"98be6376b2ec74343e0b51eab4e5f36927cfc88e"}],"manila/api/v2/services.py":[{"author":{"_account_id":29632,"name":"Carlos Eduardo","email":"ces.eduardo98@gmail.com","username":"silvacarlos"},"change_message_id":"776b390e0d0f3c9cb8b4a2c81c863586b0abea4d","unresolved":true,"context_lines":[{"line_number":46,"context_line":"                \u0027host\u0027: service[\u0027host\u0027],"},{"line_number":47,"context_line":"                \u0027zone\u0027: service[\u0027availability_zone\u0027][\u0027name\u0027],"},{"line_number":48,"context_line":"                \u0027status\u0027: \u0027disabled\u0027 if service[\u0027disabled\u0027] else \u0027enabled\u0027,"},{"line_number":49,"context_line":"                \u0027state\u0027: service[\u0027state\u0027],"},{"line_number":50,"context_line":"                \u0027updated_at\u0027: service[\u0027updated_at\u0027],"},{"line_number":51,"context_line":"            }"},{"line_number":52,"context_line":"            services.append(service)"}],"source_content_type":"text/x-python","patch_set":17,"id":"28fcf138_feb17316","line":49,"range":{"start_line":49,"start_character":26,"end_line":49,"end_character":42},"updated":"2023-02-24 02:05:35.000000000","message":"I feel this could be unsafe in terms of backwards compatibility.\nWhat I would suggest is: instead of accessing it directly, having this statement before the declaration of the service dictionary:\n\n```\nstate \u003d service.get(\u0027state\u0027)\nif not state:\n    state \u003d \u0027up\u0027 if utils.service_is_up(service) else \u0027down\u0027\n```\nthat way we could ensure it would not break. Or even version it with microversions.","commit_id":"98be6376b2ec74343e0b51eab4e5f36927cfc88e"}],"manila/data/manager.py":[{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"9ce3b7ba3712cff6705cb653b47de63756429095","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":11,"id":"cc241863_d49cc8b7","updated":"2023-02-16 06:53:16.000000000","message":"Why aren\u0027t we making this change in manila/scheduler/manager.py?","commit_id":"f749d283f0f639ac9856bb4e539406d32d132908"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"6bad53ab2d8af5e6107e4a7b1233ccf61c32bda5","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"66a37951_e28d46d9","in_reply_to":"cc241863_d49cc8b7","updated":"2023-02-20 10:54:43.000000000","message":"Done","commit_id":"f749d283f0f639ac9856bb4e539406d32d132908"}],"manila/service.py":[{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"f62c3ed8df7440ff2707c61c6b97f88c5616e2c6","unresolved":true,"context_lines":[{"line_number":237,"context_line":"        except Exception:"},{"line_number":238,"context_line":"            pass"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        try:"},{"line_number":241,"context_line":"            db.service_destroy(context.get_admin_context(), self.service_id)"},{"line_number":242,"context_line":"        except exception.NotFound:"},{"line_number":243,"context_line":"            LOG.warning(\u0027Service killed that has no database entry.\u0027)"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        if self.coordinator:"},{"line_number":246,"context_line":"            try:"},{"line_number":247,"context_line":"                coordination.LOCK_COORDINATOR.stop()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3794ca6b_f0bc39fb","line":244,"range":{"start_line":240,"start_character":8,"end_line":244,"end_character":0},"updated":"2022-09-27 18:29:10.000000000","message":"Have you tested this with multiple \"manila-share\" processes that share the same \"host\" field? Since they appear the same, won\u0027t they have the same ID on the database?","commit_id":"11fe8302058fa3715dcd8c07b65d3b429084bf5e"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"f104f7ef5ee3cb936cfae3bd2b238172e80bb9ad","unresolved":true,"context_lines":[{"line_number":237,"context_line":"        except Exception:"},{"line_number":238,"context_line":"            pass"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        try:"},{"line_number":241,"context_line":"            db.service_destroy(context.get_admin_context(), self.service_id)"},{"line_number":242,"context_line":"        except exception.NotFound:"},{"line_number":243,"context_line":"            LOG.warning(\u0027Service killed that has no database entry.\u0027)"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        if self.coordinator:"},{"line_number":246,"context_line":"            try:"},{"line_number":247,"context_line":"                coordination.LOCK_COORDINATOR.stop()"}],"source_content_type":"text/x-python","patch_set":2,"id":"dd665bfa_4b1af174","line":244,"range":{"start_line":240,"start_character":8,"end_line":244,"end_character":0},"in_reply_to":"1eb9bc71_38668e41","updated":"2022-09-28 09:45:48.000000000","message":"In order to achieve high availability of Manila Share services, it is recommended to configure host\u003d XXX in the default module to unify hostname when multiple Manila Share nodes are connected to the same storage backend.\n   I believe that even in this case, even if there is only one corresponding record in the database services table, it can be deleted at the stop service because in the report_state function, if it finds that the record is missing, a new one will be created[1]\n\n[1]https://opendev.org/openstack/manila/src/commit/486289d27ee6b3892c603bd75ab447f022d25d13/manila/service.py#L282","commit_id":"11fe8302058fa3715dcd8c07b65d3b429084bf5e"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"37a42cd993ea8030a8ce2e68a2c6cd0bbbd29fb7","unresolved":false,"context_lines":[{"line_number":237,"context_line":"        except Exception:"},{"line_number":238,"context_line":"            pass"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        try:"},{"line_number":241,"context_line":"            db.service_destroy(context.get_admin_context(), self.service_id)"},{"line_number":242,"context_line":"        except exception.NotFound:"},{"line_number":243,"context_line":"            LOG.warning(\u0027Service killed that has no database entry.\u0027)"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        if self.coordinator:"},{"line_number":246,"context_line":"            try:"},{"line_number":247,"context_line":"                coordination.LOCK_COORDINATOR.stop()"}],"source_content_type":"text/x-python","patch_set":2,"id":"4b17c64e_ecb8e5a7","line":244,"range":{"start_line":240,"start_character":8,"end_line":244,"end_character":0},"in_reply_to":"2771e2ab_45d73501","updated":"2022-12-11 07:26:40.000000000","message":"I think we have two other solutions:\n\n1: Add a scheduled task to periodically clean down services.\n2: After kill or stop a service, put db.service_destroy into the thread pool for execution. In order not to block the normal flow of kill or stop, Wait 60 seconds (default service_down_time) before executing the db.service_destroy command. If the service detects down after 60 seconds, run the db.service_destroy command; otherwise, do not execute the db.service_destroy command.\n\nhow about this? if we worried about disruption for the interval of time","commit_id":"11fe8302058fa3715dcd8c07b65d3b429084bf5e"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"08b212486db01ccd37bbfebf142642e2bb9082b8","unresolved":true,"context_lines":[{"line_number":237,"context_line":"        except Exception:"},{"line_number":238,"context_line":"            pass"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        try:"},{"line_number":241,"context_line":"            db.service_destroy(context.get_admin_context(), self.service_id)"},{"line_number":242,"context_line":"        except exception.NotFound:"},{"line_number":243,"context_line":"            LOG.warning(\u0027Service killed that has no database entry.\u0027)"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        if self.coordinator:"},{"line_number":246,"context_line":"            try:"},{"line_number":247,"context_line":"                coordination.LOCK_COORDINATOR.stop()"}],"source_content_type":"text/x-python","patch_set":2,"id":"1eb9bc71_38668e41","line":244,"range":{"start_line":240,"start_character":8,"end_line":244,"end_character":0},"in_reply_to":"3794ca6b_f0bc39fb","updated":"2022-09-28 08:24:59.000000000","message":"If you have same host name and service name (i.e. manila-share in this case) then there is only one entry in DB for multiple services. Ideally manila-share does not have same host since its host@backend i.e. host \u003d \"%s@%s\" % (CONF.host, backend)\nSo we must have \"host\" field unique to differentiate between services.","commit_id":"11fe8302058fa3715dcd8c07b65d3b429084bf5e"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"7dc98346b294d6a078362358cf7ff018a3ee7939","unresolved":false,"context_lines":[{"line_number":237,"context_line":"        except Exception:"},{"line_number":238,"context_line":"            pass"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        try:"},{"line_number":241,"context_line":"            db.service_destroy(context.get_admin_context(), self.service_id)"},{"line_number":242,"context_line":"        except exception.NotFound:"},{"line_number":243,"context_line":"            LOG.warning(\u0027Service killed that has no database entry.\u0027)"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        if self.coordinator:"},{"line_number":246,"context_line":"            try:"},{"line_number":247,"context_line":"                coordination.LOCK_COORDINATOR.stop()"}],"source_content_type":"text/x-python","patch_set":2,"id":"a872bc4e_aa7d1602","line":244,"range":{"start_line":240,"start_character":8,"end_line":244,"end_character":0},"in_reply_to":"4b17c64e_ecb8e5a7","updated":"2023-01-03 19:30:50.000000000","message":"I agree that the original issue is reported with the configuration where you have unique services on unique hosts; however, we have documented uses of the configuration for H/A where the \"host\" configuration is intentionally set to the same value.\n\nI think the solution Haixin proposes could work as well, but is a bit tricky - i.e., we need to figure out how to you identify services that are \"down\" for a reason rather than \"stopped\" -- again, we\u0027d add some info to the database perhaps to identify a service that has been stopped for cleanup. Also, would the thread run within the service targeting the same kind of service? if yes, no automatic cleanup happens when you stop all the services of a particular kind.. maybe that\u0027s okay - but it\u0027s a bit of the situation we have now.","commit_id":"11fe8302058fa3715dcd8c07b65d3b429084bf5e"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"2d361c25ebaa8720f28ad458722ddbb13154e828","unresolved":false,"context_lines":[{"line_number":237,"context_line":"        except Exception:"},{"line_number":238,"context_line":"            pass"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        try:"},{"line_number":241,"context_line":"            db.service_destroy(context.get_admin_context(), self.service_id)"},{"line_number":242,"context_line":"        except exception.NotFound:"},{"line_number":243,"context_line":"            LOG.warning(\u0027Service killed that has no database entry.\u0027)"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        if self.coordinator:"},{"line_number":246,"context_line":"            try:"},{"line_number":247,"context_line":"                coordination.LOCK_COORDINATOR.stop()"}],"source_content_type":"text/x-python","patch_set":2,"id":"c686d9ec_59bc677b","line":244,"range":{"start_line":240,"start_character":8,"end_line":244,"end_character":0},"in_reply_to":"56022bb1_81f328fc","updated":"2022-11-23 21:35:03.000000000","message":"Sorry, i\u0027m returning to this review after a while. I agree the \"report_state\" will reconcile the service reference; but there may be a disruption for the interval of time? Is there anyway we can add some another unique marker - a subkey to the service table that distinguishes different copies of the service even when host is the same?","commit_id":"11fe8302058fa3715dcd8c07b65d3b429084bf5e"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"207496c7919de4fe070009b5b5f7472a7ef9073d","unresolved":false,"context_lines":[{"line_number":237,"context_line":"        except Exception:"},{"line_number":238,"context_line":"            pass"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        try:"},{"line_number":241,"context_line":"            db.service_destroy(context.get_admin_context(), self.service_id)"},{"line_number":242,"context_line":"        except exception.NotFound:"},{"line_number":243,"context_line":"            LOG.warning(\u0027Service killed that has no database entry.\u0027)"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        if self.coordinator:"},{"line_number":246,"context_line":"            try:"},{"line_number":247,"context_line":"                coordination.LOCK_COORDINATOR.stop()"}],"source_content_type":"text/x-python","patch_set":2,"id":"2771e2ab_45d73501","line":244,"range":{"start_line":240,"start_character":8,"end_line":244,"end_character":0},"in_reply_to":"c686d9ec_59bc677b","updated":"2022-11-24 10:15:19.000000000","message":"the original issue is not with same host, but different hosts actually. \nconsider e.g. manila-scheduler \n1. deployed on host host1 [DB 1 entry of manila-scheduler]\n2. deployed on host host2 [DB 2 entries of manila-scheduler]\n3. removed from host host1 [DB, still 2 entries of manila-scheduler]\n\nWhen service manila-scheduler on host1 is stopped/removed, the manila service list should not report it. The reporting of service down based on heartbeat is fine, but reporting of service which does not exist, is wrong. In big clusters where such deployments happens as PODs, old entries in db are reported as DOWN. So we must clear DB entry on service stop and create new on service start.\n\n\u003ebut there may be a disruption for the interval of time?\nNot as such.  It is made sure that service exist even before \"report_state\" comes in picture like here https://github.com/openstack/manila/blob/master/manila/service.py#L143","commit_id":"11fe8302058fa3715dcd8c07b65d3b429084bf5e"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"e4b07d8578fcb027336242ad67ebcb99cef6cc0f","unresolved":false,"context_lines":[{"line_number":237,"context_line":"        except Exception:"},{"line_number":238,"context_line":"            pass"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        try:"},{"line_number":241,"context_line":"            db.service_destroy(context.get_admin_context(), self.service_id)"},{"line_number":242,"context_line":"        except exception.NotFound:"},{"line_number":243,"context_line":"            LOG.warning(\u0027Service killed that has no database entry.\u0027)"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        if self.coordinator:"},{"line_number":246,"context_line":"            try:"},{"line_number":247,"context_line":"                coordination.LOCK_COORDINATOR.stop()"}],"source_content_type":"text/x-python","patch_set":2,"id":"56022bb1_81f328fc","line":244,"range":{"start_line":240,"start_character":8,"end_line":244,"end_character":0},"in_reply_to":"dd665bfa_4b1af174","updated":"2022-09-30 13:04:12.000000000","message":"Thanks, removed RFC and ready to review.","commit_id":"11fe8302058fa3715dcd8c07b65d3b429084bf5e"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"fb4e31c8c556bb77affc79949b9281b4f69c3f50","unresolved":true,"context_lines":[{"line_number":146,"context_line":"                                                 self.host,"},{"line_number":147,"context_line":"                                                 self.binary)"},{"line_number":148,"context_line":"            self.service_id \u003d service_ref[\u0027id\u0027]"},{"line_number":149,"context_line":"            db.service_update(ctxt, self.service_id, {\u0027state\u0027: \u0027up\u0027})"},{"line_number":150,"context_line":"        except exception.NotFound:"},{"line_number":151,"context_line":"            self._create_service_ref(ctxt)"},{"line_number":152,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"355d59fa_ccb7f1bd","line":149,"range":{"start_line":149,"start_character":64,"end_line":149,"end_character":66},"updated":"2023-01-17 09:36:14.000000000","message":"before init_host success, the init status could be \u0027down\u0027. The rpc message cannot be processed until the initialization is successful.  After that, report_state sets the status to up.","commit_id":"2fc7bf51238a342eb5863f0dab2ab551b1c8263d"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"68508222de6a10b122490b40b89c2157debf1216","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                                                 self.host,"},{"line_number":147,"context_line":"                                                 self.binary)"},{"line_number":148,"context_line":"            self.service_id \u003d service_ref[\u0027id\u0027]"},{"line_number":149,"context_line":"            db.service_update(ctxt, self.service_id, {\u0027state\u0027: \u0027up\u0027})"},{"line_number":150,"context_line":"        except exception.NotFound:"},{"line_number":151,"context_line":"            self._create_service_ref(ctxt)"},{"line_number":152,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"71db76ce_adaca951","line":149,"range":{"start_line":149,"start_character":64,"end_line":149,"end_character":66},"in_reply_to":"355d59fa_ccb7f1bd","updated":"2023-01-17 09:51:55.000000000","message":"ok, changed initial state to \u0027DOWN\u0027.","commit_id":"2fc7bf51238a342eb5863f0dab2ab551b1c8263d"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"7dc79c16ed1ceb524607659471c01096b2bde8d2","unresolved":true,"context_lines":[{"line_number":300,"context_line":"                    service_ref[\u0027availability_zone\u0027][\u0027name\u0027]):"},{"line_number":301,"context_line":"                state_catalog[\u0027availability_zone\u0027] \u003d self.availability_zone"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"            if utils.service_is_up(service_ref):"},{"line_number":304,"context_line":"                state_catalog[\u0027state\u0027] \u003d \u0027up\u0027"},{"line_number":305,"context_line":"            else:"},{"line_number":306,"context_line":"                state_catalog[\u0027state\u0027] \u003d \u0027down\u0027"},{"line_number":307,"context_line":"            db.service_update(ctxt, self.service_id, state_catalog)"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"            # TODO(termie): make this pattern be more elegant."}],"source_content_type":"text/x-python","patch_set":8,"id":"675fc360_d27d5b33","line":306,"range":{"start_line":303,"start_character":12,"end_line":306,"end_character":47},"updated":"2023-01-17 08:31:09.000000000","message":"report_interval \u003c cleanup_interval, after stopped an service, state has been set \"stopped\", but before exec cleanup_services, exec report_state, then state of the service from \"stopped\" to \"down\",  finally we can not cleanup this services. so if the state of service has been \"stopped\", we can not set to \"down\" again.\n\n            if utils.service_is_up(service_ref):\n                state_catalog[\u0027state\u0027] \u003d \u0027up\u0027\n            else:\n                if service_ref[\u0027state\u0027] !\u003d \u0027stopped\u0027:\n                    state_catalog[\u0027state\u0027] \u003d \u0027down\u0027","commit_id":"2fc7bf51238a342eb5863f0dab2ab551b1c8263d"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"fb4e31c8c556bb77affc79949b9281b4f69c3f50","unresolved":true,"context_lines":[{"line_number":300,"context_line":"                    service_ref[\u0027availability_zone\u0027][\u0027name\u0027]):"},{"line_number":301,"context_line":"                state_catalog[\u0027availability_zone\u0027] \u003d self.availability_zone"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"            if utils.service_is_up(service_ref):"},{"line_number":304,"context_line":"                state_catalog[\u0027state\u0027] \u003d \u0027up\u0027"},{"line_number":305,"context_line":"            else:"},{"line_number":306,"context_line":"                state_catalog[\u0027state\u0027] \u003d \u0027down\u0027"},{"line_number":307,"context_line":"            db.service_update(ctxt, self.service_id, state_catalog)"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"            # TODO(termie): make this pattern be more elegant."}],"source_content_type":"text/x-python","patch_set":8,"id":"0a452976_d97c2f44","line":306,"range":{"start_line":303,"start_character":12,"end_line":306,"end_character":47},"in_reply_to":"08ea7a76_7918e0cb","updated":"2023-01-17 09:36:14.000000000","message":"I have two more questions:\n \n1:if there is only one node, as you said: The \u0027stopped\u0027 service  will never get periodic timer enabled, Does cleanup_services execute on time?\n\n2: if there are two nodes(node01 and node02). both lost connection to backend storage. now the service state is \u0027down\u0027. admin exec stop service at node01, set state of the service be \"stopped\",  node02 periodic exec report_state, then found utils.service_is_up(service_ref) if False, then state_catalog[\u0027state\u0027] \u003d \u0027down\u0027, will from \"stopped\" to \"down\", then cleanup_services skip service_destroy this service.    Is there anything missing in my description?","commit_id":"2fc7bf51238a342eb5863f0dab2ab551b1c8263d"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"68508222de6a10b122490b40b89c2157debf1216","unresolved":true,"context_lines":[{"line_number":300,"context_line":"                    service_ref[\u0027availability_zone\u0027][\u0027name\u0027]):"},{"line_number":301,"context_line":"                state_catalog[\u0027availability_zone\u0027] \u003d self.availability_zone"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"            if utils.service_is_up(service_ref):"},{"line_number":304,"context_line":"                state_catalog[\u0027state\u0027] \u003d \u0027up\u0027"},{"line_number":305,"context_line":"            else:"},{"line_number":306,"context_line":"                state_catalog[\u0027state\u0027] \u003d \u0027down\u0027"},{"line_number":307,"context_line":"            db.service_update(ctxt, self.service_id, state_catalog)"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"            # TODO(termie): make this pattern be more elegant."}],"source_content_type":"text/x-python","patch_set":8,"id":"9fe80b6d_b05c3b8f","line":306,"range":{"start_line":303,"start_character":12,"end_line":306,"end_character":47},"in_reply_to":"0a452976_d97c2f44","updated":"2023-01-17 09:51:55.000000000","message":"1. If there is only one node, the stopped service will get periodic timer enabled only when you start it again. Thereafter, it will be \u0027up\u0027 and both report_State and cleanup_services execute on time.\n\n2. If node01 is stopped, it will \u0027stopped\u0027 state while node01 will \u0027down\u0027 state. The periodic timer from service on node02, will delete the stopped i.e. node01 service. It will not change status of node02 service. In cleanup, the service check for all other services under same topic, this helps to cleanup node01 service.","commit_id":"2fc7bf51238a342eb5863f0dab2ab551b1c8263d"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"cf881f003992f2c9966ceb5ff16e9f076d1876db","unresolved":true,"context_lines":[{"line_number":300,"context_line":"                    service_ref[\u0027availability_zone\u0027][\u0027name\u0027]):"},{"line_number":301,"context_line":"                state_catalog[\u0027availability_zone\u0027] \u003d self.availability_zone"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"            if utils.service_is_up(service_ref):"},{"line_number":304,"context_line":"                state_catalog[\u0027state\u0027] \u003d \u0027up\u0027"},{"line_number":305,"context_line":"            else:"},{"line_number":306,"context_line":"                state_catalog[\u0027state\u0027] \u003d \u0027down\u0027"},{"line_number":307,"context_line":"            db.service_update(ctxt, self.service_id, state_catalog)"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"            # TODO(termie): make this pattern be more elegant."}],"source_content_type":"text/x-python","patch_set":8,"id":"908a3b17_18c4a9c1","line":306,"range":{"start_line":303,"start_character":12,"end_line":306,"end_character":47},"in_reply_to":"2e9b5c31_2e3ed373","updated":"2023-01-18 00:50:45.000000000","message":"1： that is ok.\n\n2: for example, backend storage is lvm. then node01 and node02 has same entries of service, that is manila@lvm. node01 and node02 share only one record in DB. if we set service \"stopped\" in node01. Most likely, report_state will be executed first because report_interval \u003c cleanup_interval, After report_state is executed, if utils.service_is_up(service_ref) \u003d\u003d False in node02, state of the service will be set from \"stopped\" to \"down\", finally  cleanup_services skip service_destroy this service record. That\u0027s why I recommend that the service be set to down only when the state is not stopped. how do you think about this?","commit_id":"2fc7bf51238a342eb5863f0dab2ab551b1c8263d"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"f76fa6f8a50a58b6e76dd850760b3d3b09dc7fcf","unresolved":true,"context_lines":[{"line_number":300,"context_line":"                    service_ref[\u0027availability_zone\u0027][\u0027name\u0027]):"},{"line_number":301,"context_line":"                state_catalog[\u0027availability_zone\u0027] \u003d self.availability_zone"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"            if utils.service_is_up(service_ref):"},{"line_number":304,"context_line":"                state_catalog[\u0027state\u0027] \u003d \u0027up\u0027"},{"line_number":305,"context_line":"            else:"},{"line_number":306,"context_line":"                state_catalog[\u0027state\u0027] \u003d \u0027down\u0027"},{"line_number":307,"context_line":"            db.service_update(ctxt, self.service_id, state_catalog)"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"            # TODO(termie): make this pattern be more elegant."}],"source_content_type":"text/x-python","patch_set":8,"id":"08ea7a76_7918e0cb","line":306,"range":{"start_line":303,"start_character":12,"end_line":306,"end_character":47},"in_reply_to":"675fc360_d27d5b33","updated":"2023-01-17 08:39:15.000000000","message":"The service will be \u0027stopped\u0027 when its stopped by admin. Next time when service is up, if its on same host and same binary, it will move to \u0027up\u0027 else it will remain as \u0027stopped\u0027. The report state, only consider services that are started by start() which will be either up or down. The \u0027stopped\u0027 service will never get periodic timer enabled and then it will be cleanup by cleaup_services.","commit_id":"2fc7bf51238a342eb5863f0dab2ab551b1c8263d"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"20e067f856e98a1dd1249ef47a0a8f4431b42e7c","unresolved":true,"context_lines":[{"line_number":300,"context_line":"                    service_ref[\u0027availability_zone\u0027][\u0027name\u0027]):"},{"line_number":301,"context_line":"                state_catalog[\u0027availability_zone\u0027] \u003d self.availability_zone"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"            if utils.service_is_up(service_ref):"},{"line_number":304,"context_line":"                state_catalog[\u0027state\u0027] \u003d \u0027up\u0027"},{"line_number":305,"context_line":"            else:"},{"line_number":306,"context_line":"                state_catalog[\u0027state\u0027] \u003d \u0027down\u0027"},{"line_number":307,"context_line":"            db.service_update(ctxt, self.service_id, state_catalog)"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"            # TODO(termie): make this pattern be more elegant."}],"source_content_type":"text/x-python","patch_set":8,"id":"2e9b5c31_2e3ed373","line":306,"range":{"start_line":303,"start_character":12,"end_line":306,"end_character":47},"in_reply_to":"71c9d7bd_46e0eb20","updated":"2023-01-17 10:28:07.000000000","message":"1. This is what happens today also, the service stopped will remain in DB. The stopped service is marked as stopped and not destroyed. It will be destroyed in next start() call when periodic cleanup executes. And service is only destroyed if its \u0027stopped\u0027 e.g. if it becomes \u0027up\u0027/\u0027down\u0027 it will be not destroyed. \n\n2. ok, In our case, we set as host\u003dmanila@node01 and manila@node02 and so different entries of services. And as per explained scenario, manila@node01 will be deleted once it \u0027stopped\u0027 by periodic callback of service running on manila@node02","commit_id":"2fc7bf51238a342eb5863f0dab2ab551b1c8263d"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"86acedc4afc30a964b6b06e1e8d6520e761c5815","unresolved":true,"context_lines":[{"line_number":300,"context_line":"                    service_ref[\u0027availability_zone\u0027][\u0027name\u0027]):"},{"line_number":301,"context_line":"                state_catalog[\u0027availability_zone\u0027] \u003d self.availability_zone"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"            if utils.service_is_up(service_ref):"},{"line_number":304,"context_line":"                state_catalog[\u0027state\u0027] \u003d \u0027up\u0027"},{"line_number":305,"context_line":"            else:"},{"line_number":306,"context_line":"                state_catalog[\u0027state\u0027] \u003d \u0027down\u0027"},{"line_number":307,"context_line":"            db.service_update(ctxt, self.service_id, state_catalog)"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"            # TODO(termie): make this pattern be more elegant."}],"source_content_type":"text/x-python","patch_set":8,"id":"cdddfe80_8247f8f7","line":306,"range":{"start_line":303,"start_character":12,"end_line":306,"end_character":47},"in_reply_to":"908a3b17_18c4a9c1","updated":"2023-01-18 08:28:03.000000000","message":"since you have single service representing two(or more) nodes, what do you prefer\n1) report stopped if all of them stopped i.e. delete entry in cleanup\n2) report stopped if either of them stopped i.e. delete entry in cleanup\n\nIf you prefer 2), this means there will be no service entry shown even if another node is \u0027down\u0027(and not stopped). On the other hand service is shown as \u0027up\u0027 if another node is \u0027up\u0027. I will go with 1. Let me know what suits best for your configuration and I will change accordingly.","commit_id":"2fc7bf51238a342eb5863f0dab2ab551b1c8263d"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"d68fc7eb317f884e8f7af2678249de24864242c7","unresolved":false,"context_lines":[{"line_number":300,"context_line":"                    service_ref[\u0027availability_zone\u0027][\u0027name\u0027]):"},{"line_number":301,"context_line":"                state_catalog[\u0027availability_zone\u0027] \u003d self.availability_zone"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"            if utils.service_is_up(service_ref):"},{"line_number":304,"context_line":"                state_catalog[\u0027state\u0027] \u003d \u0027up\u0027"},{"line_number":305,"context_line":"            else:"},{"line_number":306,"context_line":"                state_catalog[\u0027state\u0027] \u003d \u0027down\u0027"},{"line_number":307,"context_line":"            db.service_update(ctxt, self.service_id, state_catalog)"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"            # TODO(termie): make this pattern be more elegant."}],"source_content_type":"text/x-python","patch_set":8,"id":"34da7327_81425e50","line":306,"range":{"start_line":303,"start_character":12,"end_line":306,"end_character":47},"in_reply_to":"97ab09c3_504759d2","updated":"2023-02-13 10:24:05.000000000","message":"ok, fixed","commit_id":"2fc7bf51238a342eb5863f0dab2ab551b1c8263d"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"fe4cc83a66b5dd544981bd8665cec016a34e4184","unresolved":true,"context_lines":[{"line_number":300,"context_line":"                    service_ref[\u0027availability_zone\u0027][\u0027name\u0027]):"},{"line_number":301,"context_line":"                state_catalog[\u0027availability_zone\u0027] \u003d self.availability_zone"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"            if utils.service_is_up(service_ref):"},{"line_number":304,"context_line":"                state_catalog[\u0027state\u0027] \u003d \u0027up\u0027"},{"line_number":305,"context_line":"            else:"},{"line_number":306,"context_line":"                state_catalog[\u0027state\u0027] \u003d \u0027down\u0027"},{"line_number":307,"context_line":"            db.service_update(ctxt, self.service_id, state_catalog)"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"            # TODO(termie): make this pattern be more elegant."}],"source_content_type":"text/x-python","patch_set":8,"id":"71c9d7bd_46e0eb20","line":306,"range":{"start_line":303,"start_character":12,"end_line":306,"end_character":47},"in_reply_to":"9fe80b6d_b05c3b8f","updated":"2023-01-17 10:03:27.000000000","message":"1: that means if only one node, if admin stop service, the service still remain in database? \n\n2: we all set host\u003dmanila in node01 and node02 in manila.conf, then they have same host. for example host is manila@lvm. In this case node01 and node02 share a service record. Then my description above would be valid.","commit_id":"2fc7bf51238a342eb5863f0dab2ab551b1c8263d"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"f477447c8475aa5df08b8ec16a8de79d49506b4f","unresolved":true,"context_lines":[{"line_number":300,"context_line":"                    service_ref[\u0027availability_zone\u0027][\u0027name\u0027]):"},{"line_number":301,"context_line":"                state_catalog[\u0027availability_zone\u0027] \u003d self.availability_zone"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"            if utils.service_is_up(service_ref):"},{"line_number":304,"context_line":"                state_catalog[\u0027state\u0027] \u003d \u0027up\u0027"},{"line_number":305,"context_line":"            else:"},{"line_number":306,"context_line":"                state_catalog[\u0027state\u0027] \u003d \u0027down\u0027"},{"line_number":307,"context_line":"            db.service_update(ctxt, self.service_id, state_catalog)"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"            # TODO(termie): make this pattern be more elegant."}],"source_content_type":"text/x-python","patch_set":8,"id":"97ab09c3_504759d2","line":306,"range":{"start_line":303,"start_character":12,"end_line":306,"end_character":47},"in_reply_to":"cdddfe80_8247f8f7","updated":"2023-02-13 02:23:21.000000000","message":"Sorry for the late reply， In my opinion：\ni perfer 2), for example There are the following scenarios:\n\n1: Both node01 and node02 are disconnected from the back-end storage. the service is displayed as down if no stop is executed, the service will remain in the database and will not be deleted.\n\n2: Both node01 and node02 are disconnected from the back-end storage. Run stoped on node01. node02 finds that utils.service_is_up(service_ref) \u003d\u003d False and the state is stoped. In this case, the value should be stoped instead of down. To ensure cleanup_services can delete this service record smoothly. In my opinion, if all nodes are utils.service_is_up(service_ref) \u003d\u003d False, then as long as you execute stoped on any node, you can keep stoped until the record is deleted, rather than being reset to down.\n\n3: node01 works properly, only node02 is disconnected from the storage. Run stoped on node01. node02 finds utils.service_is_up(service_ref) \u003d\u003dTrue and resets the status from stoped to up。","commit_id":"2fc7bf51238a342eb5863f0dab2ab551b1c8263d"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"9ce3b7ba3712cff6705cb653b47de63756429095","unresolved":true,"context_lines":[{"line_number":47,"context_line":"               default\u003d10,"},{"line_number":48,"context_line":"               help\u003d\u0027Seconds between nodes reporting state to datastore.\u0027),"},{"line_number":49,"context_line":"    cfg.IntOpt(\u0027cleanup_interval\u0027,"},{"line_number":50,"context_line":"               default\u003d1800,"},{"line_number":51,"context_line":"               help\u003d\u0027Seconds between cleaning up the stopped nodes.\u0027),"},{"line_number":52,"context_line":"    cfg.IntOpt(\u0027periodic_interval\u0027,"},{"line_number":53,"context_line":"               default\u003d60,"}],"source_content_type":"text/x-python","patch_set":11,"id":"a82ea420_0671f82e","line":50,"range":{"start_line":50,"start_character":15,"end_line":50,"end_character":28},"updated":"2023-02-16 06:53:16.000000000","message":"also set a min value please.. perhaps 5 minutes?","commit_id":"f749d283f0f639ac9856bb4e539406d32d132908"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"6bad53ab2d8af5e6107e4a7b1233ccf61c32bda5","unresolved":false,"context_lines":[{"line_number":47,"context_line":"               default\u003d10,"},{"line_number":48,"context_line":"               help\u003d\u0027Seconds between nodes reporting state to datastore.\u0027),"},{"line_number":49,"context_line":"    cfg.IntOpt(\u0027cleanup_interval\u0027,"},{"line_number":50,"context_line":"               default\u003d1800,"},{"line_number":51,"context_line":"               help\u003d\u0027Seconds between cleaning up the stopped nodes.\u0027),"},{"line_number":52,"context_line":"    cfg.IntOpt(\u0027periodic_interval\u0027,"},{"line_number":53,"context_line":"               default\u003d60,"}],"source_content_type":"text/x-python","patch_set":11,"id":"c7f0147a_0e865089","line":50,"range":{"start_line":50,"start_character":15,"end_line":50,"end_character":28},"in_reply_to":"a82ea420_0671f82e","updated":"2023-02-20 10:54:43.000000000","message":"Done","commit_id":"f749d283f0f639ac9856bb4e539406d32d132908"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"9ce3b7ba3712cff6705cb653b47de63756429095","unresolved":true,"context_lines":[{"line_number":329,"context_line":"            return"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"        for svc in services:"},{"line_number":332,"context_line":"            if svc[\u0027topic\u0027] \u003d\u003d self.topic and svc[\u0027state\u0027] \u003d\u003d \u0027stopped\u0027:"},{"line_number":333,"context_line":"                db.service_destroy(ctxt, svc[\u0027id\u0027])"},{"line_number":334,"context_line":""},{"line_number":335,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"9b37b552_1fa2d4a4","line":332,"range":{"start_line":332,"start_character":30,"end_line":332,"end_character":42},"updated":"2023-02-16 06:53:16.000000000","message":"why not include this in the query above on line 325, there\u0027s a db query that you could use:\n\n topic_services \u003d db.service_get_all_by_topic(ctxt, self.topic)","commit_id":"f749d283f0f639ac9856bb4e539406d32d132908"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"6bad53ab2d8af5e6107e4a7b1233ccf61c32bda5","unresolved":false,"context_lines":[{"line_number":329,"context_line":"            return"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"        for svc in services:"},{"line_number":332,"context_line":"            if svc[\u0027topic\u0027] \u003d\u003d self.topic and svc[\u0027state\u0027] \u003d\u003d \u0027stopped\u0027:"},{"line_number":333,"context_line":"                db.service_destroy(ctxt, svc[\u0027id\u0027])"},{"line_number":334,"context_line":""},{"line_number":335,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"969d19f2_79731587","line":332,"range":{"start_line":332,"start_character":30,"end_line":332,"end_character":42},"in_reply_to":"9b37b552_1fa2d4a4","updated":"2023-02-20 10:54:43.000000000","message":"Done","commit_id":"f749d283f0f639ac9856bb4e539406d32d132908"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"9ce3b7ba3712cff6705cb653b47de63756429095","unresolved":true,"context_lines":[{"line_number":330,"context_line":""},{"line_number":331,"context_line":"        for svc in services:"},{"line_number":332,"context_line":"            if svc[\u0027topic\u0027] \u003d\u003d self.topic and svc[\u0027state\u0027] \u003d\u003d \u0027stopped\u0027:"},{"line_number":333,"context_line":"                db.service_destroy(ctxt, svc[\u0027id\u0027])"},{"line_number":334,"context_line":""},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"class WSGIService(service.ServiceBase):"}],"source_content_type":"text/x-python","patch_set":11,"id":"b416248d_5833b066","line":333,"range":{"start_line":333,"start_character":17,"end_line":333,"end_character":51},"updated":"2023-02-16 06:53:16.000000000","message":"One concern here: \n\nThis cleanup is running on an absolute timer; so it is possible that we cleanup a service as soon as it is stopped (or shortly after it is stopped) - this won\u0027t allow duplicate services from resetting the state to \"up\" as per your design... \n\nCan we avoid cleanup if the timestamp of the last report is within the cleanup_interval? That way, we can be sure to give any duplicate service at least the cleanup_interval amount of time to undo a \"stopped\" state.","commit_id":"f749d283f0f639ac9856bb4e539406d32d132908"},{"author":{"_account_id":30407,"name":"haixin","email":"haixin_haixin@qq.com","username":"haixin"},"change_message_id":"c7e53ff239599ab8595e9c80b9e44f496286ca6e","unresolved":true,"context_lines":[{"line_number":330,"context_line":""},{"line_number":331,"context_line":"        for svc in services:"},{"line_number":332,"context_line":"            if svc[\u0027topic\u0027] \u003d\u003d self.topic and svc[\u0027state\u0027] \u003d\u003d \u0027stopped\u0027:"},{"line_number":333,"context_line":"                db.service_destroy(ctxt, svc[\u0027id\u0027])"},{"line_number":334,"context_line":""},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"class WSGIService(service.ServiceBase):"}],"source_content_type":"text/x-python","patch_set":11,"id":"7eb0a60d_4ad7be84","line":333,"range":{"start_line":333,"start_character":17,"end_line":333,"end_character":51},"in_reply_to":"4c476612_88ebcf15","updated":"2023-02-17 06:26:39.000000000","message":"i perfer simply call utils.service_is_up() before cleaning up the service... .\nif utils.service_is_up() is True, then skip db.service_destroy(), then to wait next round clean up. if utils.service_is_up() is False. then will actually exec db.service_destroy().","commit_id":"f749d283f0f639ac9856bb4e539406d32d132908"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"6bad53ab2d8af5e6107e4a7b1233ccf61c32bda5","unresolved":false,"context_lines":[{"line_number":330,"context_line":""},{"line_number":331,"context_line":"        for svc in services:"},{"line_number":332,"context_line":"            if svc[\u0027topic\u0027] \u003d\u003d self.topic and svc[\u0027state\u0027] \u003d\u003d \u0027stopped\u0027:"},{"line_number":333,"context_line":"                db.service_destroy(ctxt, svc[\u0027id\u0027])"},{"line_number":334,"context_line":""},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"class WSGIService(service.ServiceBase):"}],"source_content_type":"text/x-python","patch_set":11,"id":"90d8165c_f5048a44","line":333,"range":{"start_line":333,"start_character":17,"end_line":333,"end_character":51},"in_reply_to":"7eb0a60d_4ad7be84","updated":"2023-02-20 10:54:43.000000000","message":"Done","commit_id":"f749d283f0f639ac9856bb4e539406d32d132908"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"d10b8ba52a160005fc56ad824f34c33f9ea052bd","unresolved":true,"context_lines":[{"line_number":330,"context_line":""},{"line_number":331,"context_line":"        for svc in services:"},{"line_number":332,"context_line":"            if svc[\u0027topic\u0027] \u003d\u003d self.topic and svc[\u0027state\u0027] \u003d\u003d \u0027stopped\u0027:"},{"line_number":333,"context_line":"                db.service_destroy(ctxt, svc[\u0027id\u0027])"},{"line_number":334,"context_line":""},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"class WSGIService(service.ServiceBase):"}],"source_content_type":"text/x-python","patch_set":11,"id":"4c476612_88ebcf15","line":333,"range":{"start_line":333,"start_character":17,"end_line":333,"end_character":51},"in_reply_to":"b416248d_5833b066","updated":"2023-02-16 18:47:21.000000000","message":"another option is to simply call utils.service_is_up() before cleaning up the service... \n\nThis way, the following situation can be avoided:\n\n\nshare-topic service in node1 named \"fancy.service@controller\"\nshare-topic service in node2 named \"fancy.service@controller\"\nshare-topic service on node3 named \"another.fancy.service@controller\"\n\nall three are running, and we have two database entries for \"fancy.service@controller\" and \"another.fancy.service@controller\"\n\nservice on node1 is stopped by administrator\n\ncleanup is running as usual on node2 and node3 and one of them looks at the record for \"fancy.service@controller\" and cleans it up right away; but, the service on node2 was actually fine it just wasn\u0027t reporting before the cleanup began... there was no need to delete the database entry.","commit_id":"f749d283f0f639ac9856bb4e539406d32d132908"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"b6dbf260e7e9a629ff4ab5f097ae8134d9ae1514","unresolved":true,"context_lines":[{"line_number":323,"context_line":"        \"\"\"Remove the stopped services of same topic from the datastore.\"\"\""},{"line_number":324,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":325,"context_line":"        try:"},{"line_number":326,"context_line":"            services \u003d db.service_get_all(ctxt, self.topic)"},{"line_number":327,"context_line":"        except exception.NotFound:"},{"line_number":328,"context_line":"            LOG.debug(\u0027The service database object disappeared,\u0027"},{"line_number":329,"context_line":"                      \u0027Exiting from cleanup.\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"539a0ac5_d7eb2567","line":326,"range":{"start_line":326,"start_character":26,"end_line":326,"end_character":41},"updated":"2023-02-20 21:25:09.000000000","message":"service_get_all_by_topic","commit_id":"e59bb03b18be5301894176f4bfd97d40cfa95be7"},{"author":{"_account_id":29632,"name":"Carlos Eduardo","email":"ces.eduardo98@gmail.com","username":"silvacarlos"},"change_message_id":"776b390e0d0f3c9cb8b4a2c81c863586b0abea4d","unresolved":true,"context_lines":[{"line_number":323,"context_line":"        \"\"\"Remove the stopped services of same topic from the datastore.\"\"\""},{"line_number":324,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":325,"context_line":"        try:"},{"line_number":326,"context_line":"            services \u003d db.service_get_all(ctxt, self.topic)"},{"line_number":327,"context_line":"        except exception.NotFound:"},{"line_number":328,"context_line":"            LOG.debug(\u0027The service database object disappeared,\u0027"},{"line_number":329,"context_line":"                      \u0027Exiting from cleanup.\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"d01ede2b_4c03b9ae","line":326,"range":{"start_line":326,"start_character":26,"end_line":326,"end_character":41},"in_reply_to":"539a0ac5_d7eb2567","updated":"2023-02-24 02:05:35.000000000","message":"+1\nPlease submit this in a follow-up change.","commit_id":"e59bb03b18be5301894176f4bfd97d40cfa95be7"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"6b7dc883433aaa3a9a082ec8ce34e318836edf04","unresolved":false,"context_lines":[{"line_number":323,"context_line":"        \"\"\"Remove the stopped services of same topic from the datastore.\"\"\""},{"line_number":324,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":325,"context_line":"        try:"},{"line_number":326,"context_line":"            services \u003d db.service_get_all(ctxt, self.topic)"},{"line_number":327,"context_line":"        except exception.NotFound:"},{"line_number":328,"context_line":"            LOG.debug(\u0027The service database object disappeared,\u0027"},{"line_number":329,"context_line":"                      \u0027Exiting from cleanup.\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"8f6a5052_484bcec7","line":326,"range":{"start_line":326,"start_character":26,"end_line":326,"end_character":41},"in_reply_to":"d01ede2b_4c03b9ae","updated":"2023-02-24 11:13:27.000000000","message":"Done","commit_id":"e59bb03b18be5301894176f4bfd97d40cfa95be7"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"8bfd3225a5efb0a7624b7927e38625d3f7dc7597","unresolved":true,"context_lines":[{"line_number":330,"context_line":"            return"},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"        for svc in services:"},{"line_number":333,"context_line":"            if (svc[\u0027topic\u0027] \u003d\u003d self.topic and"},{"line_number":334,"context_line":"                svc[\u0027state\u0027] \u003d\u003d \u0027stopped\u0027 and"},{"line_number":335,"context_line":"                    not utils.service_is_up(svc)):"},{"line_number":336,"context_line":"                db.service_destroy(ctxt, svc[\u0027id\u0027])"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"1dc4aadf_9dfab03e","line":335,"range":{"start_line":333,"start_character":10,"end_line":335,"end_character":50},"updated":"2023-02-23 22:03:07.000000000","message":"I\u0027m not sure why you can\u0027t use \"service_get_all_by_topic\" above... we have a query that gives you services filtered by the topic...","commit_id":"98be6376b2ec74343e0b51eab4e5f36927cfc88e"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"9b9fd781e59cf1085f486e7eac9d70ac9d73a1ed","unresolved":true,"context_lines":[{"line_number":330,"context_line":"            return"},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"        for svc in services:"},{"line_number":333,"context_line":"            if (svc[\u0027topic\u0027] \u003d\u003d self.topic and"},{"line_number":334,"context_line":"                svc[\u0027state\u0027] \u003d\u003d \u0027stopped\u0027 and"},{"line_number":335,"context_line":"                    not utils.service_is_up(svc)):"},{"line_number":336,"context_line":"                db.service_destroy(ctxt, svc[\u0027id\u0027])"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"dc1380e6_c0b885b6","line":335,"range":{"start_line":333,"start_character":10,"end_line":335,"end_character":50},"in_reply_to":"1dc4aadf_9dfab03e","updated":"2023-02-24 09:51:02.000000000","message":"yes, it was done in patchset earlier, but then rebase from different workstation might have caused it. Can I push again ?","commit_id":"98be6376b2ec74343e0b51eab4e5f36927cfc88e"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"6b7dc883433aaa3a9a082ec8ce34e318836edf04","unresolved":false,"context_lines":[{"line_number":330,"context_line":"            return"},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"        for svc in services:"},{"line_number":333,"context_line":"            if (svc[\u0027topic\u0027] \u003d\u003d self.topic and"},{"line_number":334,"context_line":"                svc[\u0027state\u0027] \u003d\u003d \u0027stopped\u0027 and"},{"line_number":335,"context_line":"                    not utils.service_is_up(svc)):"},{"line_number":336,"context_line":"                db.service_destroy(ctxt, svc[\u0027id\u0027])"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"0654eb3b_8bc943d7","line":335,"range":{"start_line":333,"start_character":10,"end_line":335,"end_character":50},"in_reply_to":"c95020c8_f5a4ca88","updated":"2023-02-24 11:13:27.000000000","message":"ok, https://review.opendev.org/c/openstack/manila/+/875002","commit_id":"98be6376b2ec74343e0b51eab4e5f36927cfc88e"},{"author":{"_account_id":29632,"name":"Carlos Eduardo","email":"ces.eduardo98@gmail.com","username":"silvacarlos"},"change_message_id":"debafe4ac1ace894c5c2e920a2d8953f71d15dc5","unresolved":true,"context_lines":[{"line_number":330,"context_line":"            return"},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"        for svc in services:"},{"line_number":333,"context_line":"            if (svc[\u0027topic\u0027] \u003d\u003d self.topic and"},{"line_number":334,"context_line":"                svc[\u0027state\u0027] \u003d\u003d \u0027stopped\u0027 and"},{"line_number":335,"context_line":"                    not utils.service_is_up(svc)):"},{"line_number":336,"context_line":"                db.service_destroy(ctxt, svc[\u0027id\u0027])"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"c95020c8_f5a4ca88","line":335,"range":{"start_line":333,"start_character":10,"end_line":335,"end_character":50},"in_reply_to":"dc1380e6_c0b885b6","updated":"2023-02-24 10:32:01.000000000","message":"Hey, Kiran!I\u0027d prefer a follow-up change for this, so we can save the votes, so please leave it as is and submit the new change asap :)","commit_id":"98be6376b2ec74343e0b51eab4e5f36927cfc88e"}]}
