)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":39407,"name":"Jianwei Guo","display_name":"Jianwei Guo","email":"guojianwei007@126.com","username":"sayaoailun"},"change_message_id":"12ab9bff90fc89b915b19823640160770400b6c7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"d511c770_f36cca1c","updated":"2026-10-26 00:25:34.000000000","message":"Thanks for the detailed review! I\u0027ve addressed all your comments:\n\n1. Removed the soft-deleted record restoration logic in quota_reserve\n2. Removed the case-insensitive duplicate check in volume_type_create  \n3. Updated volume_type_destroy to use with_for_update() for row locking, \n   check reserved !\u003d 0 before deletion, and explicitly set race_preventer\u003dNone\n4. Updated test cases accordingly\n\nAll tests passed locally. Please review.","commit_id":"eb84146509864b27517cfeb890618f2aed74b077"}],"cinder/db/api.py":[{"author":{"_account_id":36171,"name":"jayaanand borra","display_name":"jayaanand borra","email":"jayaanand.borra@netapp.com","username":"jayaanan","status":"netapp"},"change_message_id":"2b57e5d8984494f8df82299aa5e4b877a625c596","unresolved":true,"context_lines":[{"line_number":1621,"context_line":"                resources,"},{"line_number":1622,"context_line":"                resource,"},{"line_number":1623,"context_line":"            )"},{"line_number":1624,"context_line":"            # Check if there\u0027s a soft-deleted record with the same resource"},{"line_number":1625,"context_line":"            # name (case-insensitive match due to MySQL collation)."},{"line_number":1626,"context_line":"            # If found, restore it instead of creating a new record to avoid"},{"line_number":1627,"context_line":"            # unique constraint conflicts."}],"source_content_type":"text/x-python","patch_set":1,"id":"5df411f1_44632b32","line":1624,"updated":"2026-10-25 14:59:25.000000000","message":"filter_by(resource\u003dresource) is ordinary equality. It is case-insensitive only when the column collation is. quota_usages is created with mysql_charset\u003d\u0027utf8\u0027 and no collation, so that depends on the server default. This query is also outside the lock. _get_quota_usages uses with_for_update(), and the comment at line 1658 relies on the second insert raising DBDuplicateEntry because race_preventer is still true. Two updates of the same soft-deleted row both commit, and the later one overwrites in_use and reserved. Please delete this branch and keep _quota_usage_create. Once destroy sets race_preventer\u003dNULL, that insert is how N and N-1 both recreate the row.","commit_id":"4a3450e736898471f3af92fea4282deec9b7fcde"},{"author":{"_account_id":36171,"name":"jayaanand borra","display_name":"jayaanand borra","email":"jayaanand.borra@netapp.com","username":"jayaanan","status":"netapp"},"change_message_id":"2b57e5d8984494f8df82299aa5e4b877a625c596","unresolved":true,"context_lines":[{"line_number":1636,"context_line":"            if deleted_usage:"},{"line_number":1637,"context_line":"                # Restore the soft-deleted record and update resource name"},{"line_number":1638,"context_line":"                # to match the current case to avoid future conflicts"},{"line_number":1639,"context_line":"                deleted_usage.update({"},{"line_number":1640,"context_line":"                    \u0027deleted\u0027: False,"},{"line_number":1641,"context_line":"                    \u0027deleted_at\u0027: None,"},{"line_number":1642,"context_line":"                    \u0027resource\u0027: resource,  # Update to current case"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f4be2e4_b1832716","line":1639,"updated":"2026-10-25 14:59:25.000000000","message":"This undeletes the row and sets reserved\u003d0 without setting race_preventer back to true. A reservation still pointing at this usage_id then commits against a zeroed counter. If the row is still deleted when that happens, reservation_commit line 1876 and reservation_rollback line 1907 raise KeyError on usages[reservation.usage_id], because _get_quota_usages uses read_deleted\u003d\"no\". reservation_expire line 1943 loads reservation.usage through a join that requires QuotaUsage.deleted \u003d\u003d False (cinder/db/models.py:892) and raises AttributeError when that is None. Retype takes this reserve in cinder/volume/api.py before volume_type_id changes, so the new type has no volumes for the whole migration. Please do not undelete quota rows here.","commit_id":"4a3450e736898471f3af92fea4282deec9b7fcde"},{"author":{"_account_id":36171,"name":"jayaanand borra","display_name":"jayaanand borra","email":"jayaanand.borra@netapp.com","username":"jayaanan","status":"netapp"},"change_message_id":"2b57e5d8984494f8df82299aa5e4b877a625c596","unresolved":true,"context_lines":[{"line_number":4347,"context_line":"    projects \u003d projects or []"},{"line_number":4348,"context_line":"    orm_projects \u003d []"},{"line_number":4349,"context_line":""},{"line_number":4350,"context_line":"    # Check for existing volume type with case-insensitive name match"},{"line_number":4351,"context_line":"    # to prevent quota_usages conflicts due to MySQL collation"},{"line_number":4352,"context_line":"    existing_type \u003d ("},{"line_number":4353,"context_line":"        model_query(context, models.VolumeType, read_deleted\u003d\"no\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"e02138cc_cc5072f2","line":4350,"updated":"2026-10-25 14:59:25.000000000","message":"This does not run for bug 2171615. The old type is already deleted, and the query uses read_deleted\u003d\"no\". On a case-insensitive collation, _volume_type_get_by_name already matches a live rbd when the requested name is RBD. On PostgreSQL this newly raises VolumeTypeExists for two names whose quota keys do not collide. volume_types.name has no unique constraint, so two concurrent creates can both pass this SELECT. _type_update line 4601 still compares model.name \u003d\u003d values[\u0027name\u0027]. Please remove this check. A case-fold rule needs the same comparison on rename and a release note.","commit_id":"4a3450e736898471f3af92fea4282deec9b7fcde"},{"author":{"_account_id":36171,"name":"jayaanand borra","display_name":"jayaanand borra","email":"jayaanand.borra@netapp.com","username":"jayaanan","status":"netapp"},"change_message_id":"2b57e5d8984494f8df82299aa5e4b877a625c596","unresolved":true,"context_lines":[{"line_number":5181,"context_line":"        context, models.VolumeTypeProjects, read_deleted\u003d\"int_no\""},{"line_number":5182,"context_line":"    ).filter_by(volume_type_id\u003dtype_id).soft_delete(synchronize_session\u003dFalse)"},{"line_number":5183,"context_line":""},{"line_number":5184,"context_line":"    # Clean up quota_usages records for this volume type to prevent"},{"line_number":5185,"context_line":"    # unique constraint conflicts when creating volume types with"},{"line_number":5186,"context_line":"    # different case names (e.g., \u0027rbd\u0027 vs \u0027RBD\u0027)"},{"line_number":5187,"context_line":"    # NOTE: We use query.update() instead of soft_delete() because"}],"source_content_type":"text/x-python","patch_set":1,"id":"33fab741_5bbd5abd","line":5184,"updated":"2026-10-25 14:59:25.000000000","message":"Avoiding Query.soft_delete() is right: it writes deleted \u003d id into a boolean column. This update still leaves race_preventer\u003dTrue, and that is the unique column. models.QuotaUsage.delete_values() is the helper that also sets race_preventer\u003dNone; it has no callers. Please take these rows with with_for_update() and order_by(QuotaUsage.id.asc()), and raise VolumeTypeInUse before the type row is updated when reserved !\u003d 0 or a live reservation references the usage id. Hold that lock only until this writer returns. volume_type_destroy does not call RPC. if volume_type is unreachable: _volume_type_get line 4832 raises VolumeTypeNotFound. quotas and quota_classes are not cleaned; _quota_get line 1250 matches resource with the same collation, so a case-variant type can pick up the old limit. Say that in the release note or clear those rows in this transaction.","commit_id":"4a3450e736898471f3af92fea4282deec9b7fcde"}]}
