wal_level < logical error while upgrading aurora postgres db - amazon-aurora

I am trying to upgrade aurora postgres 10.11 to aurora postgres 11.9 in aws RDS aurora Postgres instance. The upgrade worked on test env, but the it gives following error on actual env
logical replication slot "replication_slot" exists, but wal_level < logical
When I checked the system settings from pg_settings, its showing that the setting "wal_level" has value "logical". and rds.logical_replication is set to 1
this query returns below results
select name, setting, sourcefile, sourceline from pg_settings where name = 'wal_level';
name |setting|sourcefile|sourceline|
---------+-------+----------+----------+
wal_level|logical| | |

https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.PostgreSQL.html
as per the above doc
Aurora DB clusters that are configured as logical replication publishers or subscribers can't undergo a major version upgrade [1].
we must drop replication slots before the upgrade and set rds.logical_replication to 0 (default) in the cluster parameter group so that a major version upgrade can go through.
and recreate the replication slots if needed.

Related

Fixing ERROR: cluster setting 'kv.rangefeed.enabled' is currently overridden by the operator in CockroachDB Serverless

I'm following a guide for setting up a changefeed on CockroachDB, but right from the start I get the error cluster setting 'kv.rangefeed.enabled' is currently overridden by the operator. How can I enable changefeeds?
In CockroachDB Serverless, it's not necessary to set kv.rangefeed.enabled--you can just skip that part of the setup. If you're setting up a changefeed to write to external endpoints, you may need to have a credit card on file in your Serverless account, but you can keep your spend limit set to $0 and still run changefeeds.

disabling automated backups for Aurora Serverless cluster

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbcluster.html says that PreferredBackupWindow is used if automated backups are enabled using the BackupRetentionPeriod parameter.
It also says that BackupRetentionPeriod Must be a value from 1 to 35.
It is actually possible to disable the automated back-ups? Setting BackupRetentionPeriod to 0 using CloudFormation return the following error: Invalid backup retention period: 0. Retention period must be between 1 and 35.
Unfortunately, you can't disable automated backups on Aurora. Even if you wanted to work around the issue by finding the most recent backup with
aws rds describe-db-cluster-snapshots --db-cluster-identifier=dbname | jq -r .DBClusterSnapshots[].DBClusterSnapshotIdentifier | tail -n1
and then attempting to manually delete the backup with
aws rds delete-db-cluster-snapshot --db-cluster-snapshot-identifier rds:dbname-2021-03-30-04-56
this results in the error
An error occurred (InvalidDBClusterSnapshotStateFault)
when calling the DeleteDBClusterSnapshot operation:
Only manual snapshots may be deleted.
It appears that you have a read replica for your DB instance. Unfortunately due to the instance having read replicas connecting to it, you won't be able to set backup retention to 0. Backups are required to create and manage read replicas binary logs.
"Before a DB instance can serve as a replication source, you must enable automatic backups on the source DB instance by setting the backup retention period to a value other than 0. This requirement also applies to a read replica that is the source DB instance for another read replica."

Evolving Tarantool instance

What should we do if we have one tarantool instance (without Cartridge or VShard), then sometimes in the future we need to replicate it to another machine without downtime?
or if it's the easiest way is using cartridge, how to connect to tarantool cartridge from outside the cardridge? for example using golang (what's the username and password?):
taran, err = tarantool.Connect(cfg.Tarantool.Addr, tarantool.Opts{
User: cfg.Tarantool.User,
Pass: cfg.Tarantool.Pass,
Reconnect: 10 * time.Second,
MaxReconnects: 8640,
})
for example in other database only need to attach a new slave from the master (1 command line call) and wait for it to be sync (100% replicated).
Not sure I'll completely answer your question. But let's discuss every point separately.
Replication
You can use replication without vshard or cartridge. vshard is a module for sharding, if you don't need sharding you can use only replication feature.
Read about replication in documentation configuration - https://www.tarantool.io/en/doc/latest/book/replication/. Cartridge is just framework that simplifies cluster management and gives you huge amount of useful features.
User password
Also you ask about users/passwords. After you call box.cfg{listen=...} you could create some user, alter some rights for it and change its password. Please, read about user management in Tarantool in our documentation - https://www.tarantool.io/en/doc/latest/book/box/authentication/. After you create some user you can connect to Tarantool instance via connector, console (using tarantoolctl) or another Tarantool (using net.box module) under this user.
Talking about cartridge, it uses system user admin with cluster-cookie as a password.

Replica database is not accessible in Read Scale Availability Group in SQL Server 2017 Standard edition

I'm looking into ways of replicating databases from On-Premise environments to Azure and one of the options I found was setting up a Read-Scale availability group.
The reason I'm using a Read-Scale and not an Always On availability group, is because I don't won't to use SQL Server Enterprise edition due to the cost.
I followed a tutorial from Microsoft (MS TUTORIAL) to set this all up and in the end, I think I got it working as my database appeared on the Azure environment.
However, the problem is that my replica always stays in the Synchronizing state - which is probably due to the fact I chose Asynchronous Replication by using the AVAILABILITY_MODE = ASYNCHRONOUS_COMMIT command - but even worse is that I can't access the database itself.
Each time I try to fire a query against it, it comes back with an Object is not accessible exception.
After some reading, I found that the cause of this might be because my replica doesn't have a secondary role. Trying to set this via the ... SECONDARY_ROLE({ALLOW_CONNECTIONS = ALL})... command, clearly states that this feature is not available in the Standard version of SQL Server.
My whole confusion comes from the fact that on the Microsoft documentation (MS DOCS), it says that With availability groups, one or more secondary replicas can be configured to support read-only access to secondary databases. which is exactly what I'm not succeeding in.
Did anybody have the same issue, or knows how to configure the Read-Scale availability group on SQL Server Standard so my second replica is accessible and readable as well?
P.S. I did look at the actual SQL Replication with Transaction Replication, but there are quite a bit of moving parts there, so I'm exploring all options before making a decision.
Based on a twitter conversation I found out that you will need to create a snapshot of the database in Secondary Replica in order to read from there.
Please read this tweeter thread.
I also added a suggestion in the feedback channel to fix the documentation.

Heroku Mongo Url (Copying db from heroku)

I'm trying to write a script that copys my heroku db to my local db (mongodb), but I dont have a clue what kind of url format this is:
mongodb://<username>:<password>#lamppost.5.mongolayer.com:10049,lamppost.4.mongolayer.com:10049/<appname>
Why are there two urls, comma separated?
Does anyone have a working script to share? :)
The format is a MongoDB Connection String URI for a replica set.
The two hosts listed are members of the replica set provided as a "seed list" for connecting to your MongoHQ instance. Specifying more than one member of the replica set allows for failover -- the MongoDB driver will attempt to connect to the first available member of the seed list in order to discover the current configuration of a replica set.
You can use this URI to connect from Ruby via MongoClient.from_uri(uri).

Resources