MongoDB

Channel Revision Published Runs on
6/stable 199 04 Oct 2024
Ubuntu 22.04
6/candidate 199 04 Oct 2024
Ubuntu 22.04
6/beta 199 04 Oct 2024
Ubuntu 22.04
6/edge 206 13 Dec 2024
Ubuntu 22.04
5/stable 117 20 Apr 2023
Ubuntu 22.04
5/candidate 117 20 Apr 2023
Ubuntu 22.04
5/edge 139 21 Nov 2023
Ubuntu 22.04 Ubuntu 20.04
5/edge 109 06 Mar 2023
Ubuntu 22.04 Ubuntu 20.04
3.6/stable 100 28 Apr 2023
Ubuntu 20.04 Ubuntu 18.04
3.6/candidate 100 13 Apr 2023
Ubuntu 20.04 Ubuntu 18.04
3.6/edge 100 03 Feb 2023
Ubuntu 20.04 Ubuntu 18.04
juju deploy mongodb --channel 6/stable
Show information

Platform:

Ubuntu
22.04 20.04 18.04

charms.mongodb.v0.set_status

Code for handing statuses in the app and unit.


class MongoDBStatusHandler

Description

Verifies versions across multiple integrated applications. None

Methods

MongoDBStatusHandler. __init__( self , charm: CharmBase )

Constructor for CrossAppVersionChecker.

Arguments

charm

charm to inherit from.

MongoDBStatusHandler. set_and_share_status( self , status: StatusBase )

Description

Sets the charm status and shares to app status and config-server if applicable. None

MongoDBStatusHandler. set_app_status( self )

Description

TODO Future Feature/Epic: parse statuses and set a status for the entire app. None

MongoDBStatusHandler. is_current_unit_ready( self , ignore_unhealthy_upgrade: bool )

Returns True if the current unit status shows that the unit is ready.

Description

Note: we allow the use of ignore_unhealthy_upgrade, to avoid infinite loops due to this function returning False and preventing the status from being reset.

Returns True if the current status is related to a mimsatch in revision.

Description

Note: A few functions calling this method receive states differently. One receives them by "goal state" which processes data differently and the other via the ".status" property. Hence we have to be flexible to handle each.

MongoDBStatusHandler. are_all_units_ready_for_upgrade( self , unit_to_ignore: str )

Description

Returns True if all charm units status's show that they are ready for upgrade. None

MongoDBStatusHandler. are_shards_status_ready_for_upgrade( self )

Returns True if all integrated shards status's show that they are ready for upgrade.

Description

A shard is ready for upgrade if it is either in the waiting for upgrade status or active status.

MongoDBStatusHandler. share_status_to_config_server( self )

Description

Shares this shards status info to the config server. None

MongoDBStatusHandler. is_unit_status_ready_for_upgrade( self )

Description

Returns True if the status of the current unit reflects that it is ready for upgrade. None

MongoDBStatusHandler. process_statuses( self )

Retrieves statuses from processes inside charm and returns the highest priority status.

Description

When a non-fatal error occurs while processing statuses, the error is processed and returned as a statuses.

TODO: add more status handling here for other cases: i.e. TLS, or resetting a status that should not be reset

MongoDBStatusHandler. get_statuses( self )

Description

Retrieves statuses for the different processes running inside the unit. None

MongoDBStatusHandler. prioritize_statuses( self , statuses: Tuple )

Description

Returns the status with the highest priority from backups, sharding, and mongod. None

MongoDBStatusHandler. get_invalid_integration_status( self )

Description

Returns a status if an invalid integration is present. None

MongoDBStatusHandler. get_cluster_mismatched_revision_status( self )

Description

Returns a Status if the cluster has mismatched revisions. None

def build_unit_status(
    mongodb_config: MongoConfiguration,
    unit_host: str
)

Description

Generates the status of a unit based on its status reported by mongod. None