- Newest
- Most votes
- Most comments
Hello There,
I understand that you came across the mentioned extra fields, upon querying SELECT * FROM certain Aurora MySQL information_schema tables and would like to know their uses.
Aurora MySQL has certain information_schema tables that are specific to Aurora. The 'information_schema.REPLICA_HOST_STATUS' table contains replication information. The 5 columns which are documented i.e 'CPU', 'IS_CURRENT', 'LAST_UPDATE_TIMESTAMP', 'REPLICA_LAG_IN_MILLISECONDS', 'SERVER_ID', AND 'SESSION_ID' are just the selected columns out of all the extra fields mentioned here: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora_replica_status.html
To answer your questions one-by-one:
-
Yes, the description on these extra fields mentioned in the below link are applicable for Aurora MySQL as well, though the link belongs to PostgreSQL as these serve as the general fields which hold the same description. https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora_replica_status.html
-
'READ_IOS' column represents the total number of read I/O operations that have been performed on the table pages of the replica host since the replication started.
So, 'READ_IOS' indicates the cumulative count of read requests that have been executed on the table pages of the replica host since the replication process began.
Regarding the relationship between 'READ_IOS' and 'PENDING_READ_IOS', they have the same value if there are no pending read operations at the moment you execute the query. However, if there are ongoing or pending read operations, you may observe a difference between the two metrics.
It is important to note that these values may differ when there is a larger load or when the buffer cache is unable to quickly satisfy all read requests. In such cases, the number of pending read I/O operations 'PENDING_READ_IOS' would increase, indicating that read operations are waiting to be serviced.
While 'READ_IOS' and 'PENDING_READ_IOS' may have the same value in some cases, they represent different aspects of read operations and might diverge when there is a larger demand or contention for resources.
-
'IS_CURRENT' value represents the status of the replica host in relation to the primary instance. A non zero value indicates that the replica host is currently in sync with the primary instance. It means that the replica is up to date and replicating changes from the primary without any lag.
You can find out which replicas are now in sync with the primary instance and which ones might be experiencing replication latency by querying the 'information_schema.REPLICA_HOST_STATUS' table and checking the 'IS_CURRENT' value for each replica host.
-
The LSN (Log Sequence Number) fields in Aurora MySQL, such as 'DURABLE_LSN' and 'HIGHEST_LSN_RECEIVED', Can not be taken as metric to compare or calculate replica lag between MySQL or Aurora MySQL Instances. This feature is not applicable as per design.
-
As you know that Aurora can have one writer instance and multiple reader instances, it uses storage level replication to sync the data between writer and reader nodes.
-
The LSN of Aurora MySQL is tied to data changes at storage layer in aurora. Any modification at storage layer keeps moving the LSN record forward.
-
The LSN would be changing even if there is no activity on aurora, because the underlying monitoring system keeps updating its latest health records on internal storage. Therefore LSN is never at halt and it keeps moving.
-
Because of the design, LSN is again a independent metric for each of the instances participating in Aurora cluster. Therefore, ideally you can not use LSN for calculating the replication lag between Aurora Instances.
Please see this article regarding Aurora replica lag: [+] https://aws.amazon.com/premiumsupport/knowledge-center/aurora-read-replica-restart/
-
No, the above fields does not does not directly show the number of client connections active to a replica as they primarily focuse on the status of replica hosts within the replication setup. However, To determine the number of client connections open to a replica in Aurora MySQL, you can use the
SHOW PROCESSLIST
command. [+]https://dev.mysql.com/doc/refman/8.0/en/show-processlist.html -
Regarding the parameters 'OLDEST_READ_VIEW_TRX_ID' and 'CURRENT_READ_POINT': 'OLDEST_READ_VIEW_TRX_ID' denotes the Transaction ID of the oldest active read transaction's view in the database. It shows the point in the transaction log up to which the database has processed transactions.
'CURRENT_READ_POINT', on the other hand, represents the current Transaction ID of the executing transaction in the database.
That said, these fields are mainly related to the internal workings of the database transaction processing.
I hope that the above information was quite helpful. Have a great day ahead! :)
Relevant content
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 25 days ago
Thank you much for the info above! This is very useful so far.
I have another question. Given I know a reader replica's direct host name/URL/port e.g. abcdetc-0.xyz.eu-west-1.rds.amazonaws.com, I'm seeing connection timeouts trying to do mysql_real_connect's to that (i.e. instead of trying to connect to the cluster's reader endpoint which has a format like abcdetc.cluster-ro-xyz.eu-west-1.rds.amazonaws.com). Is there some specific access permission, or something missing needed to do this? (E.g. to load balance using a custom smart driver, by going directly to a selected replica) Thanks