[SERVER-73636] Coverity analysis defect 135025: Inefficient vector resizing with reserve. Created: 06/Feb/23  Updated: 29/Oct/23  Resolved: 10/Feb/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.2.24, 4.4.19, 5.0.15, 7.0.0-rc0, 6.0.5, 6.2.1, 6.3.0-rc1

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Dan Larkin-York
Resolution: Fixed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Assigned Teams:
Storage Execution
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.3, v6.2, v6.0, v5.0, v4.4, v4.2
Sprint: Execution Team 2023-02-20
Participants:

 Description   

Inefficient vector resizing with reserve.

This operation, if performed to grow large vectors, may take a very long time to complete. A vector's capacity is increased with reserve in a manner that causes many unnecessary copies.
/src/mongo/db/catalog/index_consistency.cpp:285: INEFFICIENT_RESERVE 135025 A "std::vector" has its capacity adjusted with "reserve()" in a manner that is likely to have severe performance penalties.



 Comments   
Comment by Githook User [ 11/Feb/23 ]

Author:

{'name': 'Dan Larkin-York', 'email': 'dan.larkin-york@mongodb.com', 'username': 'dhly-etc'}

Message: SERVER-72512 SERVER-73636 Ensure validate surfaces index key inconsistencies if they exist

(cherry picked from commit c0e1438cad31e00372a9f9edaee80f9db5a4e8ed)
(cherry picked from commit 2d90115a227572cc0f46b309ceb47dda6b740da3)
Branch: v6.2
https://github.com/mongodb/mongo/commit/4852124956f6f10a1042f78706004251ccebc367

Comment by Githook User [ 11/Feb/23 ]

Author:

{'name': 'Dan Larkin-York', 'email': 'dan.larkin-york@mongodb.com', 'username': 'dhly-etc'}

Message: SERVER-72512 SERVER-73636 Ensure validate surfaces index key inconsistencies if they exist

(cherry picked from commit c0e1438cad31e00372a9f9edaee80f9db5a4e8ed)
(cherry picked from commit 2d90115a227572cc0f46b309ceb47dda6b740da3)
Branch: v4.2
https://github.com/mongodb/mongo/commit/bcf0c75c8dbed2a84ad69ba5bd7aa200115f8cb9

Comment by Githook User [ 11/Feb/23 ]

Author:

{'name': 'Dan Larkin-York', 'email': 'dan.larkin-york@mongodb.com', 'username': 'dhly-etc'}

Message: SERVER-72512 SERVER-73636 Ensure validate surfaces index key inconsistencies if they exist

(cherry picked from commit c0e1438cad31e00372a9f9edaee80f9db5a4e8ed)
(cherry picked from commit 2d90115a227572cc0f46b309ceb47dda6b740da3)
Branch: v4.4
https://github.com/mongodb/mongo/commit/71715290cbe0caeac6911176b9721d664444d19a

Comment by Githook User [ 10/Feb/23 ]

Author:

{'name': 'Dan Larkin-York', 'email': 'dan.larkin-york@mongodb.com', 'username': 'dhly-etc'}

Message: SERVER-72512 SERVER-73636 Ensure validate surfaces index key inconsistencies if they exist

(cherry picked from commit c0e1438cad31e00372a9f9edaee80f9db5a4e8ed)
(cherry picked from commit 2d90115a227572cc0f46b309ceb47dda6b740da3)
Branch: v6.0
https://github.com/mongodb/mongo/commit/ddc6aac0cb45838f26df7fa4028cabd3662d0189

Comment by Githook User [ 10/Feb/23 ]

Author:

{'name': 'Dan Larkin-York', 'email': 'dan.larkin-york@mongodb.com', 'username': 'dhly-etc'}

Message: SERVER-73636 Fix poor allocation pattern in validation reporting

(cherry picked from commit 2d90115a227572cc0f46b309ceb47dda6b740da3)
Branch: v6.3
https://github.com/mongodb/mongo/commit/96399bf635e3916f9d5bc87ad2b3876eb89350a9

Comment by Githook User [ 10/Feb/23 ]

Author:

{'name': 'Dan Larkin-York', 'email': 'dan.larkin-york@mongodb.com', 'username': 'dhly-etc'}

Message: SERVER-72512 SERVER-73636 Ensure validate surfaces index key inconsistencies if they exist

(cherry picked from commit c0e1438cad31e00372a9f9edaee80f9db5a4e8ed)
(cherry picked from commit 2d90115a227572cc0f46b309ceb47dda6b740da3)
Branch: v5.0
https://github.com/mongodb/mongo/commit/0353b731683058472611e819baf4e02547f691c8

Comment by Githook User [ 10/Feb/23 ]

Author:

{'name': 'Dan Larkin-York', 'email': 'dan.larkin-york@mongodb.com', 'username': 'dhly-etc'}

Message: SERVER-73636 Fix poor allocation pattern in validation reporting
Branch: master
https://github.com/mongodb/mongo/commit/2d90115a227572cc0f46b309ceb47dda6b740da3

Generated at Thu Feb 08 06:25:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.