[SERVER-35907] Database Profiler should provide information about the write concern Created: 29/Jun/18 Updated: 27/Oct/23 Resolved: 06/Aug/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Diagnostics |
| Affects Version/s: | 3.6.5 |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Niklas Wenzel | Assignee: | Asya Kamsky |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | profiling | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
I would like to confirm that a third-party library uses the correct write concern when sending commands to the MongoDB instance. There currently does not seem to be a way to do that. Proposed solution: Make the database profiler store the write concern of each operation in the database's system.profile collection when the profiling level is set to 2. |
| Comments |
| Comment by Asya Kamsky [ 23/Sep/18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
We have reconsidered the ticket and decided against it - we have already seen some confusion when writes and overall batches are logged separately as well as worried that the totals won’t “add up” or at least will be more difficult to interpret if we wrote them to profile separately. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Niklas Wenzel [ 13/Sep/18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thank you, Asya! Can we then reopen this issue to have the write concern logged in the system.profile collection for update operations as well? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Asya Kamsky [ 26/Aug/18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
You can check write concern for update command in the logs. The update has two operations, the update command which specifies (and waits for) write concern and the update/write which is what happens to get recorded in the system.profile collection. The mongod logs will contain both however. Here's an example:
As you can see, the second line corresponding to the command has the writeConcern logged. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Niklas Wenzel [ 15/Aug/18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Running commands in mongo shell, I noticed the following:
I haven't tested what happens when running other types of operations. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Niklas Wenzel [ 15/Aug/18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thank you for your reply, Asya. I had a look at it again and I don't see the information in my system.profiles collection that you see. More details about my setup:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Asya Kamsky [ 06/Aug/18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This is already the case. After setting profiling level here is what I see in system.profile collection:
|