From 9ab65836aa9df6e5de03364392841076c70ce396 Mon Sep 17 00:00:00 2001 From: Jason Price Date: Fri, 15 Jan 2021 09:29:54 -0800 Subject: [PATCH] DOCS-14084 Add resharding section to server status --- source/reference/command/serverStatus.txt | 414 +++++++++++++++++++++- source/release-notes/5.0.txt | 6 + 2 files changed, 418 insertions(+), 2 deletions(-) diff --git a/source/reference/command/serverStatus.txt b/source/reference/command/serverStatus.txt index 82998f7d362..a5fb26c1a39 100644 --- a/source/reference/command/serverStatus.txt +++ b/source/reference/command/serverStatus.txt @@ -2551,7 +2551,28 @@ shardingStatistics "countFullRefreshesStarted" : NumberLong(), "countFailedRefreshes" : NumberLong() }, - "rangeDeleterTasks" : + "rangeDeleterTasks" : , + "resharding" : { + "successfulOperations" : NumberLong(), + "failedOperations" : NumberLong(), + "canceledOperations" : NumberLong(), + "totalOperationTimeElapsedMillis" : NumberLong(), + "remainingOperationTimeEstimatedMillis" : NumberLong(), + "approxDocumentsToCopy" : NumberLong(), + "documentsCopied" : NumberLong(), + "approxBytesToCopy" : NumberLong(), + "bytesCopied" : NumberLong(), + "totalCopyTimeElapsedMillis" : NumberLong(), + "oplogEntriesFetched" : NumberLong(), + "oplogEntriesApplied" : NumberLong(), + "totalApplyTimeElapsedMillis" : NumberLong(), + "countWritesDuringCriticalSection" : NumberLong(), + "totalCriticalSectionTimeElapsedMillis" : NumberLong(), + "donorState" : , + "recipientState" : , + "coordinatorState" : , + "opStatus" : + } }, - id: mongos @@ -2670,7 +2691,7 @@ shardingStatistics Cumulative, always-increasing count of chunks this member, acting as the primary of the recipient shard, has started to receive (whether - the move has succeeded or not. + the move has succeeded or not). *Only present when run on a shard.* @@ -2837,7 +2858,396 @@ shardingStatistics Only present when run on a :binary:`~bin.mongos`. .. versionadded:: 4.2.7 + +.. serverstatus:: shardingStatistics.resharding + + A document with statistics about resharding operations. + + Each shard returns its own resharding operation statistics. If a + shard is not involved in a resharding operation, then that shard will + not contain statistics about the resharding operation. + + *Only present when run on a shard or config server.* + + .. versionadded:: 5.0 + +.. serverstatus:: shardingStatistics.resharding.successfulOperations + + Number of successful resharding operations. Number is set to 0 when + :binary:`~bin.mongod` is started or restarted. + + *Only present when run on a shard or config server.* + + .. versionadded:: 5.0 + +.. serverstatus:: shardingStatistics.resharding.failedOperations + + Number of failed resharding operations. Number is set to 0 when + :binary:`~bin.mongod` is started or restarted. + + *Only present when run on a shard or config server.* + + .. versionadded:: 5.0 + +.. serverstatus:: shardingStatistics.resharding.canceledOperations + + Number of canceled resharding operations. Number is set to 0 when + :binary:`~bin.mongod` is started or restarted. + + *Only present when run on a shard or config server.* + + .. versionadded:: 5.0 + +.. serverstatus:: shardingStatistics.resharding.totalOperationTimeElapsedMillis + + Total elapsed time, in milliseconds, for the current resharding + operation. Time is set to 0 when a new resharding operation starts. + + *Only present when run on a shard or config server. Returns 0 on a + config server.* + + .. versionadded:: 5.0 + +.. serverstatus:: shardingStatistics.resharding.remainingOperationTimeEstimatedMillis + + Estimated remaining time, in milliseconds, for the current resharding + operation. Time is set to 0 when a new resharding operation starts. + + *Only present when run on a shard or config server. Returns 0 on a + config server.* + + .. versionadded:: 5.0 + +.. serverstatus:: shardingStatistics.resharding.approxDocumentsToCopy + + Approximate number of documents to copy from donor shards to + recipient shards for the current resharding operation. Number is an + estimate that is set when the resharding operation starts and the + number is not updated as the operation progresses. Number is set to + 0 when a new resharding operation starts. + + *Only present when run on a shard or config server. Returns 0 on a + config server.* + + .. versionadded:: 5.0 + +.. serverstatus:: shardingStatistics.resharding.documentsCopied + + Number of documents copied from donor shards to recipient shards for + the current resharding operation. Number is set to 0 when a new + resharding operation starts. + + *Only present when run on a shard or config server. Returns 0 on a + config server.* + + .. versionadded:: 5.0 + +.. serverstatus:: shardingStatistics.resharding.approxBytesToCopy + + Approximate number of bytes to copy from donor shards to recipient + shards for the current resharding operation. Number is an estimate + that is set when the resharding operation starts and the number is + not updated as the operation progresses. Number is set to 0 when a + new resharding operation starts. + + *Only present when run on a shard or config server. Returns 0 on a + config server.* + + .. versionadded:: 5.0 + +.. serverstatus:: shardingStatistics.resharding.bytesCopied + + Number of bytes copied from donor shards to recipient shards for the + current resharding operation. Number is set to 0 when a new + resharding operation starts. + + *Only present when run on a shard or config server. Returns 0 on a + config server.* + + .. versionadded:: 5.0 + +.. serverstatus:: shardingStatistics.resharding.totalCopyTimeElapsedMillis + + Total elapsed time, in milliseconds, for ongoing data copy tasks from + donor shards to recipient shards for the current resharding + operation. Time is set to 0 when a new resharding operation starts. + + *Only present when run on a shard or config server. Returns 0 on a + config server.* + + .. versionadded:: 5.0 + +.. serverstatus:: shardingStatistics.resharding.oplogEntriesFetched + + Number of entries fetched from the :term:`oplog` for the current + resharding operation. Number is set to 0 when a new resharding + operation starts. + + *Only present when run on a shard or config server. Returns 0 on a + config server.* + +.. serverstatus:: shardingStatistics.resharding.oplogEntriesApplied + + Number of entries applied to the :term:`oplog` for the current + resharding operation. Number is set to 0 when a new resharding + operation starts. + + *Only present when run on a shard or config server. Returns 0 on a + config server.* + + .. versionadded:: 5.0 + +.. serverstatus:: shardingStatistics.resharding.totalApplyTimeElapsedMillis + + Total elapsed time, in milliseconds, for the apply step of the + current resharding operation. In the apply step, recipient shards + modify their data based on new incoming writes from donor shards. + Time is set to 0 when a new resharding operation starts. + + *Only present when run on a shard or config server. Returns 0 on a + config server.* + + .. versionadded:: 5.0 + +.. serverstatus:: shardingStatistics.resharding.countWritesDuringCriticalSection + + Number of writes perfomed in the critical section for the current + resharding operation. The critical section prevents new incoming + writes to the collection currently being resharded. Number is set to + 0 when a new resharding operation starts. + + *Only present when run on a shard or config server. Returns 0 on a + config server.* + + .. versionadded:: 5.0 + +.. serverstatus:: shardingStatistics.resharding.totalCriticalSectionTimeElapsedMillis + + Total elapsed time, in milliseconds, for the critical section part of + the current resharding operation. The critical section prevents new + incoming writes to the collection currently being resharded. Time is + set to 0 when a new resharding operation starts. + + *Only present when run on a shard or config server. Returns 0 on a + config server.* + + .. versionadded:: 5.0 + +.. serverstatus:: shardingStatistics.resharding.donorState + + State of the donor shard for the current resharding operation. Number + is set to 0 when a new resharding operation starts. + .. list-table:: + :header-rows: 1 + :widths: 15 20 40 + + * - Number Returned + - Meaning + - Description + + * - 0 + - ``unused`` + - Shard is not a donor in the current resharding operation. + + * - 1 + - ``preparing-to-donate`` + - Donor shard preparing to donate data to recipient shard. + + * - 2 + - ``donating-initial-data`` + - Donor shard donating data to recipient shard. + + * - 3 + - ``donating-oplog-entries`` + - Donor shard donating :term:`oplog` entries to recipient shard. + + * - 4 + - ``preparing-to-mirror`` + - Donor shard preventing new incoming write operations to the + collection being resharded. + + * - 5 + - ``mirroring`` + - Donor shard preventing new incoming write operations, and + donor shard has notified all recipient shards that new + incoming writes are prevented. + + * - 6 + - ``dropping`` + - Donor shard dropping old sharded collection. + + * - 7 + - ``done`` + - Resharding operation is complete. + + * - 8 + - ``error`` + - Error occurred during resharding operation. + + *Only present when run on a shard or config server. Returns 0 on a + config server.* + + .. versionadded:: 5.0 + +.. serverstatus:: shardingStatistics.resharding.recipientState + + State of the recipient shard for the current resharding operation. + Number is set to 0 when a new resharding operation starts. + + .. list-table:: + :header-rows: 1 + :widths: 15 20 40 + + * - Number Returned + - Meaning + - Description + + * - 0 + - ``unused`` + - Shard is not a recipient in the current resharding operation. + + * - 1 + - ``creating-collection`` + - Recipient shard creating new sharded collection. + + * - 2 + - ``cloning`` + - Recipient shard receiving data from donor shards. + + * - 3 + - ``applying`` + - Recipient shard modifying its copy of the data based on the + new incoming writes from donor shards. Recipient shards + apply changes from :term:`oplog` entries generated by + donor shards. Recipient shard data is not yet consistent with + donor shard data, but will be when the steady state is + reached. + + * - 4 + - ``steady-state`` + - Steady state is reached. Recipient shard data is consistent + with donor shard data. + + * - 5 + - ``strict-consistency`` + - Recipient shard has all data changes. + + * - 6 + - ``renaming`` + - Recipient shard renaming new sharded collection. + + * - 7 + - ``done`` + - Resharding operation is complete. + + * - 8 + - ``error`` + - Error occurred during resharding operation. + + *Only present when run on a shard or config server. Returns 0 on a + config server.* + + .. versionadded:: 5.0 + +.. serverstatus:: shardingStatistics.resharding.coordinatorState + + State of the resharding coordinator for the current resharding + operation. The resharding coordinator is a thread that runs on the + :doc:`config server ` primary. + Number is set to 0 when a new resharding operation starts. + + .. list-table:: + :header-rows: 1 + :widths: 15 20 40 + + * - Number Returned + - Meaning + - Description + + * - 0 + - ``unused`` + - Shard is not the coordinator in the current resharding + operation. + + * - 1 + - ``initializing`` + - Resharding coordinator informs shards to begin resharding + operation. + + * - 2 + - ``preparing-to-donate`` + - Resharding coordinator informs donor shards to prepare to + donate data to recipient shards. + + * - 3 + - ``cloning`` + - Resharding coordinator informs donor shards to donate data to + recipient shards. + + * - 4 + - ``applying`` + - Resharding coordinator informs recipient shards to modify the + copy of data based on new incoming writes from donor shards. + + * - 5 + - ``mirroring`` + - Resharding coordinator informs donor shards to prevent new + incoming write operations to the collection being resharded. + + * - 6 + - ``committed`` + - Resharding coordinator has updated the metadata + for the collection being resharded, but the resharding + coordinator has not yet informed the donor or recipient shards + of the update. The metadata is stored in the + :data:`~config.collections`, :data:`~config.chunks`, and + :data:`~config.tags` collections. + + * - 7 + - ``renaming`` + - Resharding coordinator informs recipient shards to rename new + sharded collection. + + * - 8 + - ``done`` + - Resharding operation is complete. + + * - 9 + - ``error`` + - Error occurred during resharding operation. + + *Only present when run on a shard or config server.* + + .. versionadded:: 5.0 + +.. serverstatus:: shardingStatistics.resharding.opStatus + + Status for the current resharding operation. + + .. list-table:: + :header-rows: 1 + :widths: 10 40 + + * - Number Returned + - Description + + * - -1 + - Resharding operation not in progress. + + * - 0 + - Resharding operation succeeded. + + * - 1 + - Resharding operation failed. + + * - 2 + - Resharding operation canceled. + + *Only present when run on a shard or config server.* + + .. versionadded:: 5.0 + .. _server-status-sharded-index-consistency: shardedIndexConsistency diff --git a/source/release-notes/5.0.txt b/source/release-notes/5.0.txt index 19238add0cf..eff6cf86627 100644 --- a/source/release-notes/5.0.txt +++ b/source/release-notes/5.0.txt @@ -236,6 +236,12 @@ output: number of incoming connections from clients that are assigned to threads that service client requests + Resharding Statistics + .. list-table:: + + * - | :serverstatus:`shardingStatistics.resharding`, which + reports statistics about resharding operations + Additional ``dbStats`` Free Space Statistics ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~