Make the most of compiled C loops on the 68000

The other day I was working on my pet project ngdevkit, an open source C development kit for the Neo Geo hardware. I needed to write a simple clear_screen function, and I chose to do it in C for simplicity, in the hope that this would get efficiently compiled into 68000 assembly. That apparently innocuous task led me to some interesting findings regarding gcc, binutils, and how you can hint the compiler to generate efficient 68000 code for small loops to reclaim some of your precious clock cycles.

Read more…

Connecting to MariaDB with auth_ed25519 and PyMySQL

When a MySQL client wants to connect to a MySQL or MariaDB server, the MySQL wire protocol specifies how both parties should exchange data, advertise their capabilities, and which authentication method they should use for the client to get connected. By default, this authentication is a challenge-response scheme that relies on SHA-1. But starting MariaDB 10.1.22, a new cryptographic-based authentication mechanism called auth_ed25519 can be used for improved security at connection time, and PyMySQL recently added support for it.

Read more…

Troubleshooting open_files_limit in MariaDB

It may happen in the MariaDB logs that you see failures to set open_files_limit:

160318 21:48:04 [Warning] option 'open_files_limit': unsigned value 18446744073709551615 adjusted to 4294967295
160318 21:48:04 [Warning] option 'open_files_limit': unsigned value 18446744073709551615 adjusted to 4294967295
160318 21:48:04 [Warning] Could not increase number of max_open_files to more than 1024 (request: 4907)

Meaning MariaDB was unable to raise the limit of maximum file descriptors at startup, with all the subsequent problems it can cause. Sometimes it is simply due to a bad setting in configuration files, such as:

open_files_limit=-1

Read more…

Galera boot process in Open Stack HA and manual override

Deployments of OpenStack that rely on MariaDB+Galera benefit from a HA database thanks to Galera's synchronous replication. In such deployments, the Galera cluster is typically managed via Pacemaker, by means of a galera resource agent.

While Galera itself has its own notion of cluster management (membership, health check, write-set replication...), a resource agent is still necessary for Pacemaker to perform the basic cluster management duties, for example:

  • Starting up the Galera servers on the available nodes in the cluster

  • Health monitoring and recovery actions on failure (e.g. fencing)

This document describes the concepts involved in booting a Galera cluster, how the galera resource agent implements the boot process of a galera cluster, and how it can be overriden for recovery scenarios.

Read more…