)]}'
{"keystone/common/sql/core.py":[{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"8ffaa40ac11e9ccac740242bfc1777dd954b30bd","unresolved":false,"context_lines":[{"line_number":217,"context_line":""},{"line_number":218,"context_line":"def session_for_write():"},{"line_number":219,"context_line":"    if CONF.read_only_mode:"},{"line_number":220,"context_line":"        # Fail the entire request because we\u0027re in read-only mode, and this is"},{"line_number":221,"context_line":"        # write operation is critical to the application."},{"line_number":222,"context_line":"        raise exception.ReadOnlyMode()"},{"line_number":223,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_9fb3ab97","line":220,"range":{"start_line":220,"start_character":76,"end_line":220,"end_character":78},"updated":"2016-08-01 21:48:54.000000000","message":"nit: remove \u0027is\u0027 or even take out this part of the sentence.","commit_id":"3ce08d120777af60ee7d198180d20ea8dc5bfd10"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"685fa391e99192359a0301b63ee0b231cb1bf236","unresolved":false,"context_lines":[{"line_number":217,"context_line":""},{"line_number":218,"context_line":"def session_for_write():"},{"line_number":219,"context_line":"    if CONF.read_only_mode:"},{"line_number":220,"context_line":"        # Fail the entire request because we\u0027re in read-only mode, and this is"},{"line_number":221,"context_line":"        # write operation is critical to the application."},{"line_number":222,"context_line":"        raise exception.ReadOnlyMode()"},{"line_number":223,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_54da89ea","line":220,"in_reply_to":"bacf61ea_9fb3ab97","updated":"2016-08-02 15:41:29.000000000","message":"Done","commit_id":"3ce08d120777af60ee7d198180d20ea8dc5bfd10"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"f4eaa8fe024755af3ae13b80cc6e2ed76ddc9024","unresolved":false,"context_lines":[{"line_number":218,"context_line":"def session_for_write():"},{"line_number":219,"context_line":"    if CONF.read_only_mode:"},{"line_number":220,"context_line":"        # Fail the entire request because we\u0027re in read-only mode, and this"},{"line_number":221,"context_line":"        # write operation is critical to the application."},{"line_number":222,"context_line":"        raise exception.ReadOnlyMode()"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"    if _TESTING_USE_GLOBAL_CONTEXT_MANAGER:"}],"source_content_type":"text/x-python","patch_set":3,"id":"bacf61ea_c5ce5f82","line":221,"range":{"start_line":221,"start_character":26,"end_line":221,"end_character":37},"updated":"2016-08-04 10:32:42.000000000","message":"Instead of saying it is critical I\u0027d say it just be banned for what\u0027s going on, rolling upgrade for example.","commit_id":"41e3c5692b4718a7fb45ba9ea650e508b44b988e"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"866b5515f09288b8f48d2e4033f48609afbfd87f","unresolved":false,"context_lines":[{"line_number":218,"context_line":"def session_for_write():"},{"line_number":219,"context_line":"    if CONF.read_only_mode:"},{"line_number":220,"context_line":"        # Fail the entire request because we\u0027re in read-only mode, and this"},{"line_number":221,"context_line":"        # write operation is critical to the application."},{"line_number":222,"context_line":"        raise exception.ReadOnlyMode()"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"    if _TESTING_USE_GLOBAL_CONTEXT_MANAGER:"}],"source_content_type":"text/x-python","patch_set":3,"id":"bacf61ea_84bd6c6a","line":221,"in_reply_to":"bacf61ea_c5ce5f82","updated":"2016-08-04 19:59:04.000000000","message":"Can there be other uses for a read-only mode? I imagine there could be, even though rolling upgrades are a significant one. Knowing that I\u0027d be in favor of keeping the comment generic.","commit_id":"41e3c5692b4718a7fb45ba9ea650e508b44b988e"}],"keystone/conf/default.py":[{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"8ffaa40ac11e9ccac740242bfc1777dd954b30bd","unresolved":false,"context_lines":[{"line_number":228,"context_line":"    \u0027read_only_mode\u0027,"},{"line_number":229,"context_line":"    default\u003dFalse,"},{"line_number":230,"context_line":"    help\u003dutils.fmt(\"\"\""},{"line_number":231,"context_line":"When enabled, keystone will entirely skip any non-critical write operations to"},{"line_number":232,"context_line":"the database, and will return 503 Service Unavailable for any critical write"},{"line_number":233,"context_line":"operations. This is useful during upgrades, such as when keystone cannot be"},{"line_number":234,"context_line":"confident of the database schema to which it is writing."}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_1f4dfb99","line":231,"range":{"start_line":231,"start_character":14,"end_line":231,"end_character":75},"updated":"2016-08-01 21:48:54.000000000","message":"Won\u0027t it return 503 for any write operations?","commit_id":"3ce08d120777af60ee7d198180d20ea8dc5bfd10"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"fb0d23fd06ebdc05a5850868226b154c42221acb","unresolved":false,"context_lines":[{"line_number":228,"context_line":"    \u0027read_only_mode\u0027,"},{"line_number":229,"context_line":"    default\u003dFalse,"},{"line_number":230,"context_line":"    help\u003dutils.fmt(\"\"\""},{"line_number":231,"context_line":"When enabled, keystone will entirely skip any non-critical write operations to"},{"line_number":232,"context_line":"the database, and will return 503 Service Unavailable for any critical write"},{"line_number":233,"context_line":"operations. This is useful during upgrades, such as when keystone cannot be"},{"line_number":234,"context_line":"confident of the database schema to which it is writing."}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_52dc6174","line":231,"range":{"start_line":231,"start_character":46,"end_line":231,"end_character":58},"updated":"2016-08-02 14:09:47.000000000","message":"you say non-critical? but don\u0027t ALL our write requests use session_for_write? this will essentially fail any write operation","commit_id":"3ce08d120777af60ee7d198180d20ea8dc5bfd10"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"fb0d23fd06ebdc05a5850868226b154c42221acb","unresolved":false,"context_lines":[{"line_number":228,"context_line":"    \u0027read_only_mode\u0027,"},{"line_number":229,"context_line":"    default\u003dFalse,"},{"line_number":230,"context_line":"    help\u003dutils.fmt(\"\"\""},{"line_number":231,"context_line":"When enabled, keystone will entirely skip any non-critical write operations to"},{"line_number":232,"context_line":"the database, and will return 503 Service Unavailable for any critical write"},{"line_number":233,"context_line":"operations. This is useful during upgrades, such as when keystone cannot be"},{"line_number":234,"context_line":"confident of the database schema to which it is writing."}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_f20c753d","line":231,"range":{"start_line":231,"start_character":14,"end_line":231,"end_character":75},"in_reply_to":"bacf61ea_1f4dfb99","updated":"2016-08-02 14:09:47.000000000","message":"yep, this doesn\u0027t match the implementation","commit_id":"3ce08d120777af60ee7d198180d20ea8dc5bfd10"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"548f7d0a6be35b7f8e1dfb7ccec9366eee9d7ee4","unresolved":false,"context_lines":[{"line_number":228,"context_line":"    \u0027read_only_mode\u0027,"},{"line_number":229,"context_line":"    default\u003dFalse,"},{"line_number":230,"context_line":"    help\u003dutils.fmt(\"\"\""},{"line_number":231,"context_line":"When enabled, keystone will entirely skip any non-critical write operations to"},{"line_number":232,"context_line":"the database, and will return 503 Service Unavailable for any critical write"},{"line_number":233,"context_line":"operations. This is useful during upgrades, such as when keystone cannot be"},{"line_number":234,"context_line":"confident of the database schema to which it is writing."}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_14e651e8","line":231,"in_reply_to":"bacf61ea_52dc6174","updated":"2016-08-02 15:37:38.000000000","message":"Yes and no. I looked into two ways of solving the \"optional\" part, and have settled on the more verbose approach for the moment.\n\nMy elegant solution was to add an \"optional\" or \"skip_in_read_only_mode\" argument to session_for_write() such that operations like updating a user\u0027s invalid password lockout count could be silently skipped when in read-only mode. The advantage to this approach is that any logic inside the context manager still gets executed, it just won\u0027t have an effect on the database.\n\n\n  def _increment_invalid_password_count(self):\n    with session_for_write(optional\u003dTrue) as session:\n      session.update_things()\n\nHowever, preventing writes from inside a context manager proved to be a little complicated (I was trying to stomp on the session\u0027s flush method with a no-op). I could get back to it, but we don\u0027t have many use cases for optional writes (yet), so it didn\u0027t seem to be worth the effort.\n\nInstead, we can write drivers with a conditional before grabbing a write session:\n\n  def _increment_invalid_password_count(self):\n    if not CONF.read_only_mode:\n      with session_for_write() as session:\n        session.update_things()","commit_id":"3ce08d120777af60ee7d198180d20ea8dc5bfd10"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"8ffaa40ac11e9ccac740242bfc1777dd954b30bd","unresolved":false,"context_lines":[{"line_number":230,"context_line":"    help\u003dutils.fmt(\"\"\""},{"line_number":231,"context_line":"When enabled, keystone will entirely skip any non-critical write operations to"},{"line_number":232,"context_line":"the database, and will return 503 Service Unavailable for any critical write"},{"line_number":233,"context_line":"operations. This is useful during upgrades, such as when keystone cannot be"},{"line_number":234,"context_line":"confident of the database schema to which it is writing."},{"line_number":235,"context_line":"\"\"\"))"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_c2170a43","line":234,"range":{"start_line":233,"start_character":12,"end_line":234,"end_character":55},"updated":"2016-08-01 21:48:54.000000000","message":"I would just say \"This is especially useful when upgrading multiple keystone nodes.\"  The \"keystone cannot be confident...\" sentence, while true, sounds strange to me.","commit_id":"3ce08d120777af60ee7d198180d20ea8dc5bfd10"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"548f7d0a6be35b7f8e1dfb7ccec9366eee9d7ee4","unresolved":false,"context_lines":[{"line_number":231,"context_line":"When enabled, keystone will entirely skip any non-critical write operations to"},{"line_number":232,"context_line":"the database, and will return 503 Service Unavailable for any critical write"},{"line_number":233,"context_line":"operations. This is useful during upgrades, such as when keystone cannot be"},{"line_number":234,"context_line":"confident of the database schema to which it is writing."},{"line_number":235,"context_line":"\"\"\"))"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_543e092a","line":234,"in_reply_to":"bacf61ea_c2170a43","updated":"2016-08-02 15:37:38.000000000","message":"++","commit_id":"3ce08d120777af60ee7d198180d20ea8dc5bfd10"},{"author":{"_account_id":8482,"name":"Colleen Murphy","email":"colleen@gazlene.net","username":"krinkle"},"change_message_id":"e8464c6172765881604af4e287ab78ef6dcf143e","unresolved":false,"context_lines":[{"line_number":229,"context_line":"    default\u003dFalse,"},{"line_number":230,"context_line":"    help\u003dutils.fmt(\"\"\""},{"line_number":231,"context_line":"When enabled, keystone will entirely skip any non-critical write operations to"},{"line_number":232,"context_line":"the database, and will return 503 Service Unavailable for any critical write"},{"line_number":233,"context_line":"operations. This is especially useful when upgrading multiple keystone nodes."},{"line_number":234,"context_line":"\"\"\"))"},{"line_number":235,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bacf61ea_f8a7e408","line":232,"updated":"2016-08-03 21:22:05.000000000","message":"What are examples of non-critical versus critical writes? I can\u0027t think of any POST or PATCH operation where it is acceptable to silently not write anything.","commit_id":"aff6d155d43413d9a322747e72fbed7e00defe68"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"3d7d8c6bb4d8604a6d2772bc1a4f628f94932041","unresolved":false,"context_lines":[{"line_number":229,"context_line":"    default\u003dFalse,"},{"line_number":230,"context_line":"    help\u003dutils.fmt(\"\"\""},{"line_number":231,"context_line":"When enabled, keystone will entirely skip any non-critical write operations to"},{"line_number":232,"context_line":"the database, and will return 503 Service Unavailable for any critical write"},{"line_number":233,"context_line":"operations. This is especially useful when upgrading multiple keystone nodes."},{"line_number":234,"context_line":"\"\"\"))"},{"line_number":235,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bacf61ea_b8972cea","line":232,"in_reply_to":"bacf61ea_f8a7e408","updated":"2016-08-03 21:40:29.000000000","message":"We have several proposed in gerrit as part of the PCI-DSS spec. Essentially, in order to maintain zero downtime during an upgrade process, we\u0027d have to briefly sacrifice some of those security features (such as local user account lockout after X number of failed attempts).","commit_id":"aff6d155d43413d9a322747e72fbed7e00defe68"},{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"15ae066d035bd16312d810040f4a1303f5c1b603","unresolved":false,"context_lines":[{"line_number":230,"context_line":"    help\u003dutils.fmt(\"\"\""},{"line_number":231,"context_line":"When enabled, keystone will entirely skip any non-critical write operations to"},{"line_number":232,"context_line":"the database, and will return 503 Service Unavailable for any critical write"},{"line_number":233,"context_line":"operations. This is especially useful when upgrading multiple keystone nodes."},{"line_number":234,"context_line":"\"\"\"))"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bacf61ea_a13f0924","line":233,"range":{"start_line":233,"start_character":12,"end_line":233,"end_character":76},"updated":"2016-08-03 16:04:26.000000000","message":"++","commit_id":"aff6d155d43413d9a322747e72fbed7e00defe68"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"f4eaa8fe024755af3ae13b80cc6e2ed76ddc9024","unresolved":false,"context_lines":[{"line_number":229,"context_line":"    default\u003dFalse,"},{"line_number":230,"context_line":"    help\u003dutils.fmt(\"\"\""},{"line_number":231,"context_line":"When enabled, keystone will entirely skip any non-critical write operations to"},{"line_number":232,"context_line":"the database, and will return 503 Service Unavailable for any critical write"},{"line_number":233,"context_line":"operations. This is especially useful when upgrading multiple keystone nodes."},{"line_number":234,"context_line":"\"\"\"))"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"bacf61ea_c572df7b","line":233,"range":{"start_line":232,"start_character":62,"end_line":233,"end_character":10},"updated":"2016-08-04 10:32:42.000000000","message":"Is there a list for each release on which write operation are critical, so that ServiceUnavailable will be raised?","commit_id":"41e3c5692b4718a7fb45ba9ea650e508b44b988e"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"866b5515f09288b8f48d2e4033f48609afbfd87f","unresolved":false,"context_lines":[{"line_number":230,"context_line":"    help\u003dutils.fmt(\"\"\""},{"line_number":231,"context_line":"When enabled, keystone will entirely skip any non-critical write operations to"},{"line_number":232,"context_line":"the database, and will return 503 Service Unavailable for any critical write"},{"line_number":233,"context_line":"operations. This is especially useful when upgrading multiple keystone nodes."},{"line_number":234,"context_line":"\"\"\"))"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"bacf61ea_844bac86","line":233,"in_reply_to":"bacf61ea_c572df7b","updated":"2016-08-04 19:59:04.000000000","message":"++ I thought all writes would have been considered critical during a rolling upgrade.","commit_id":"41e3c5692b4718a7fb45ba9ea650e508b44b988e"}],"keystone/exception.py":[{"author":{"_account_id":18338,"name":"Ron De Rose","email":"ronald.de.rose@intel.com","username":"derosenet"},"change_message_id":"8ffaa40ac11e9ccac740242bfc1777dd954b30bd","unresolved":false,"context_lines":[{"line_number":484,"context_line":""},{"line_number":485,"context_line":"class ServiceUnavailable(Error):"},{"line_number":486,"context_line":"    message_format \u003d _(\"The server is currently unable to handle the request \""},{"line_number":487,"context_line":"                       \"due to a temporary overloading or maintenance of the \""},{"line_number":488,"context_line":"                       \"server.\")"},{"line_number":489,"context_line":"    code \u003d 503"},{"line_number":490,"context_line":"    title \u003d \u0027Service Unavailable\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_227706a1","line":487,"range":{"start_line":487,"start_character":33,"end_line":487,"end_character":54},"updated":"2016-08-01 21:48:54.000000000","message":"Why not just say, \"The server is currently unable to handle the request, please try again later.\"","commit_id":"3ce08d120777af60ee7d198180d20ea8dc5bfd10"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"685fa391e99192359a0301b63ee0b231cb1bf236","unresolved":false,"context_lines":[{"line_number":484,"context_line":""},{"line_number":485,"context_line":"class ServiceUnavailable(Error):"},{"line_number":486,"context_line":"    message_format \u003d _(\"The server is currently unable to handle the request \""},{"line_number":487,"context_line":"                       \"due to a temporary overloading or maintenance of the \""},{"line_number":488,"context_line":"                       \"server.\")"},{"line_number":489,"context_line":"    code \u003d 503"},{"line_number":490,"context_line":"    title \u003d \u0027Service Unavailable\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_74a6ad54","line":487,"in_reply_to":"bacf61ea_227706a1","updated":"2016-08-02 15:41:29.000000000","message":"Because I copied this from the HTTP 1.1 spec :)","commit_id":"3ce08d120777af60ee7d198180d20ea8dc5bfd10"}]}
