$ cat /tmp/sites.sql
CREATE TABLE sites(
site_id bigint,
name varchar(128),
primary key(site_id)
);
$ cat /tmp/sites.vschema
{
😶🌫️
For VReplication streams, we must choose a tablet to serve the role of vstreamer (source) and vapplier (target) in the replication stream.
Key context for the tablet picker: cells, keyspace, shard, and tablet types (primary/master, replica).
ℹ️ VReplication will only look for tablet pairings within the same cell. If you want to have cross-cell streams then you will need to create a CellAlias that contains the list of potential cells and specify that using the
-cell
flag in your VReplication workflow commands.
The tablet picker logic for is here. It gets a set of valid candidates for the source and target of the stream:
- Source (vstreamer): it uses the random ta
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> SELECT @@version; | |
+-----------+ | |
| @@version | | |
+-----------+ | |
| 8.0.25 | | |
+-----------+ | |
1 row in set (0.00 sec) | |
mysql> SELECT UUID() INTO @myuuid; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# Signed into https://app.planetscale.com using GitHub | |
## | |
# Install CLI | |
$ brew tap planetscale/tap | |
$ brew install pscale | |
$ pscale login |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> select @@version; | |
+-----------+ | |
| @@version | | |
+-----------+ | |
| 8.0.25 | | |
+-----------+ | |
1 row in set (0.00 sec) | |
mysql> select "Hey! 🙂" = "Hey! 😡" collate utf8mb4_general_ci; | |
+------------------------------------------------+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The Pos column in the _vt.vreplication table is the vreplication equivalent of mysqld's @@global.gtid_executed value | |
The hard part is finding the source GTID you think you want to skip, verifying the contents of it and that it matches the error, and finally that it's safe to skip | |
You can find the source tablet for that errored vstream in the workflow output, e.g.: | |
... | |
{ | |
"Shard": "-", | |
"Tablet": "us_central1_a-3612345650", | |
"ID": 16, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯ echo "${RANDOM}:${RANDOM}:${RANDOM} -- cat beer mustang mountain noway -- you are the owner of Matt's art, congrats" > /tmp/nft-input.txt | |
❯ cat /tmp/nft-input.txt | |
4303:3459:12817 -- cat beer mustang mountain noway -- you are the owner of Matt's art, congrats | |
❯ shasum -a 256 /tmp/nft-input.txt | awk '{print $1}' > /tmp/mattsart-nft.txt | |
❯ cat /tmp/mattsart-nft.txt | |
3bcbd498e57d4bcd85abeeb79fb006f483801043517d555902939bd70c85f925 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is the demo that I walked through in this talk: https://www.slideshare.net/mattalord/using-mysql-containers | |
Let's look at our current Docker environment: | |
docker version | |
docker info | |
docker system df | |
# as you play around, I would recommend you run this once in a while: docker system prune && docker volume prune | |
docker stats | |
docker ps -a | |
docker network ls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mongodb.iot_guestbook; | |
import com.mongodb.embedded.client.*; | |
import com.mongodb.client.MongoClient; | |
import com.mongodb.client.MongoDatabase; | |
import com.mongodb.client.MongoCollection; | |
import com.mongodb.client.MongoCursor; | |
import com.mongodb.client.model.Projections; | |
import com.mongodb.client.model.Sorts; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <mongoc_embedded/mongoc_embedded.h> | |
int main (int argc, char *argv[]) | |
{ | |
mongo_embedded_v1_status *status; | |
mongo_embedded_v1_lib *lib; | |
mongo_embedded_v1_instance *instance; | |
mongoc_client_t *client; | |
mongoc_collection_t *collection; | |
mongoc_cursor_t *cursor; |