Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Icinga DB Version 1.2.1 #871

Merged
merged 3 commits into from
Dec 18, 2024
Merged

Release Icinga DB Version 1.2.1 #871

merged 3 commits into from
Dec 18, 2024

Conversation

oxzi
Copy link
Member

@oxzi oxzi commented Dec 6, 2024

Release the maintenance/bug fix version 1.2.1 as talked about with @lippserd the other day.

The following needs to be done before this can be merged:

@oxzi oxzi added this to the 1.2.1 milestone Dec 6, 2024
@oxzi oxzi requested a review from lippserd December 6, 2024 09:40
@oxzi oxzi self-assigned this Dec 6, 2024
@cla-bot cla-bot bot added the cla/signed label Dec 6, 2024
@oxzi
Copy link
Member Author

oxzi commented Dec 6, 2024

After #856 was merged, there are no further schema changes left. Thus, verify that the schema upgrades don't diverge from the schema file.

MySQL/MariaDB

$ docker run --name mariadb -e MARIADB_ROOT_PASSWORD=supersicher -p 3306:3306 -d mariadb:latest

$ docker exec -it mariadb mariadb --password=supersicher --binary-as-hex
MariaDB [(none)]> create database icingadb;
MariaDB [(none)]> ^D

$ git checkout v1.2.0

$ docker exec -i mariadb mariadb -p --password=supersicher --binary-as-hex icingadb < schema/mysql/schema.sql

$ git checkout main
$ git rev-parse HEAD
f923d6f8db339181cf06ba2f5ab9342f2202e082

$ docker exec -i mariadb mariadb -p --password=supersicher --binary-as-hex icingadb < schema/mysql/upgrades/1.3.0.sql
$ docker exec -it mariadb mariadb-dump -p --password=supersicher icingadb > pr871-mysql-after-upgrade.sql

$ docker exec -it mariadb mariadb --password=supersicher --binary-as-hex
MariaDB [(none)]> drop database icingadb;
MariaDB [(none)]> create database icingadb;
MariaDB [(none)]> ^D

$ docker exec -i mariadb mariadb -p --password=supersicher --binary-as-hex icingadb < schema/mysql/schema.sql
$ docker exec -it mariadb mariadb-dump -p --password=supersicher icingadb > pr871-mysql-schema-import.sql

$ diff -u pr871-mysql-*
--- pr871-mysql-after-upgrade.sql       2024-12-06 11:43:22.718883308 +0100
+++ pr871-mysql-schema-import.sql       2024-12-06 11:44:11.762328164 +0100
@@ -966,7 +966,7 @@
   `version` smallint(5) unsigned NOT NULL,
   `timestamp` bigint(20) unsigned NOT NULL,
   PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;
 /*!40101 SET character_set_client = @saved_cs_client */;

 --
@@ -976,8 +976,7 @@
 LOCK TABLES `icingadb_schema` WRITE;
 /*!40000 ALTER TABLE `icingadb_schema` DISABLE KEYS */;
 INSERT INTO `icingadb_schema` VALUES
-(1,5,1733481717000),
-(2,6,1733481764000);
+(1,6,1733481840000);
 /*!40000 ALTER TABLE `icingadb_schema` ENABLE KEYS */;
 UNLOCK TABLES;

@@ -2027,4 +2026,4 @@
 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
 /*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;

--- Dump completed on 2024-12-06 10:43:22
+-- Dump completed on 2024-12-06 10:44:11

PostgreSQL

$ docker run --name postgres-icingadb -e POSTGRES_PASSWORD=supersicher -p 5432:5432 -d postgres:latest

$ docker exec -it postgres-icingadb psql -U postgres
postgres=# create database icingadb;
CREATE DATABASE
postgres=# ^D

$ git checkout v1.2.0

$ docker exec -i postgres-icingadb psql -U postgres icingadb < schema/pgsql/schema.sql

$ git checkout main
$ git rev-parse HEAD
f923d6f8db339181cf06ba2f5ab9342f2202e082

$ docker exec -i postgres-icingadb psql -U postgres icingadb < schema/pgsql/upgrades/1.3.0.sql
$ docker exec -i postgres-icingadb pg_dump -U postgres icingadb > pr871-pgsql-after-upgrade.sql

$ docker exec -it postgres-icingadb psql -U postgres
postgres=# drop database icingadb;
postgres=# create database icingadb;
CREATE DATABASE
postgres=# ^D

$ docker exec -i postgres-icingadb psql -U postgres icingadb < schema/pgsql/schema.sql
$ docker exec -i postgres-icingadb pg_dump -U postgres icingadb > pr871-pgsql-schema-import.sql

$ diff -u pr871-pgsql-*
--- pr871-pgsql-after-upgrade.sql       2024-12-06 11:53:39.536355797 +0100
+++ pr871-pgsql-schema-import.sql       2024-12-06 11:55:16.043910346 +0100
@@ -575,6 +575,7 @@
 ALTER TABLE ONLY public.checkcommand_argument ALTER COLUMN id SET STORAGE PLAIN;
 ALTER TABLE ONLY public.checkcommand_argument ALTER COLUMN environment_id SET STORAGE PLAIN;
 ALTER TABLE ONLY public.checkcommand_argument ALTER COLUMN checkcommand_id SET STORAGE PLAIN;
+ALTER TABLE ONLY public.checkcommand_argument ALTER COLUMN argument_key SET STORAGE PLAIN;
 ALTER TABLE ONLY public.checkcommand_argument ALTER COLUMN properties_checksum SET STORAGE PLAIN;


@@ -4395,8 +4396,7 @@
 --

 COPY public.icingadb_schema (id, version, "timestamp") FROM stdin;
-1      3       1733482310976
-2      4       1733482349477
+1      4       1733482499824
 \.


@@ -4668,7 +4668,7 @@
 -- Name: icingadb_schema_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
 --

-SELECT pg_catalog.setval('public.icingadb_schema_id_seq', 2, true);
+SELECT pg_catalog.setval('public.icingadb_schema_id_seq', 1, true);


 --

Unfortunately, there was actually one difference in the PostgreSQL schema update, introduced by me in #792. The ALTER command lost the STORAGE attribute, as shown in the diff above. Mea culpa :/

I have pushed another commit to this PR addressing this and re-verified this.

PostgreSQL w/ schema update in this PR

$ docker run --name postgres-icingadb -e POSTGRES_PASSWORD=supersicher -p 5432:5432 -d postgres:latest

$ docker exec -it postgres-icingadb psql -U postgres
postgres=# create database icingadb;
CREATE DATABASE
postgres=# ^D

$ git checkout v1.2.0

$ docker exec -i postgres-icingadb psql -U postgres icingadb < schema/pgsql/schema.sql

$ git checkout main
$ git rev-parse HEAD
f923d6f8db339181cf06ba2f5ab9342f2202e082

$ docker exec -i postgres-icingadb psql -U postgres icingadb < schema/pgsql/upgrades/1.2.1.sql
$ docker exec -i postgres-icingadb pg_dump -U postgres icingadb > pr871-pgsql-after-upgrade-with-change.sql

$ diff -u pr871-pgsql-after-upgrade-with-change.sql pr871-pgsql-schema-import.sql
--- pr871-pgsql-after-upgrade-with-change.sql   2024-12-06 12:15:33.294668799 +0100
+++ pr871-pgsql-schema-import.sql       2024-12-06 11:55:16.043910346 +0100
@@ -4396,8 +4396,7 @@
 --

 COPY public.icingadb_schema (id, version, "timestamp") FROM stdin;
-1      3       1733483690687
-2      4       1733483712794
+1      4       1733482499824
 \.


@@ -4669,7 +4668,7 @@
 -- Name: icingadb_schema_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
 --

-SELECT pg_catalog.setval('public.icingadb_schema_id_seq', 2, true);
+SELECT pg_catalog.setval('public.icingadb_schema_id_seq', 1, true);


 --

@oxzi oxzi force-pushed the release-1.2.1 branch 2 times, most recently from b02ec98 to 6d4af79 Compare December 6, 2024 11:51
@oxzi
Copy link
Member Author

oxzi commented Dec 16, 2024

Ftr, I have created a draft blog post on icinga.com containing this changelog entry wrapped in a bit prose.

@oxzi
Copy link
Member Author

oxzi commented Dec 17, 2024

@lippserd: Currently, Icinga DB uses the icinga-go-library in version 0.3.1 while the v0.4.0 milestone is almost done (one approved PR and one with dispute, which could also be moved to the next release v0.5.0).

Releasing an icinga-go-library version 0.4.0 and including it in this Icinga DB release would give us the benefits of Icinga/icinga-go-library#59 and Icinga/icinga-go-library#23, where the first one addresses a real issue, #787 (comment).

@oxzi oxzi force-pushed the release-1.2.1 branch 2 times, most recently from 5f30037 to cc2a09f Compare December 17, 2024 10:04
@oxzi
Copy link
Member Author

oxzi commented Dec 17, 2024

While editing the CHANGELOG, I have escaped one leading # in an older paragraph, as it resulted in a headline in our docs markdown parser, https://icinga.com/docs/icinga-db/latest/CHANGELOG/.

@oxzi oxzi requested a review from lippserd December 17, 2024 16:13
oxzi added 2 commits December 17, 2024 22:18
During #792, the storage mode for this column got lost. After further
inspection, setting a distinct storage mode for a column of type varchar
seems unnecessary.
The AUTHORS file was updated with the following command, moving duplicate
entities to the .mailmap first.

> $ git log --use-mailmap --format='format:%aN <%aE>' v1.0.0..HEAD \
>     | grep -v '^dependabot' >> AUTHORS
> $ sort -uo AUTHORS AUTHORS
lippserd
lippserd previously approved these changes Dec 17, 2024
Copy link
Member

@lippserd lippserd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for changing the PostgreSQL schema, the changelog also reads well 👍

@oxzi
Copy link
Member Author

oxzi commented Dec 18, 2024

I just reran some tests, build a single node scenario which I have upgraded, and ran an HA scenario relying on a Galera database where I manually introduced lots of networking and service interruptions. Everything worked so far.

@oxzi oxzi requested a review from lippserd December 18, 2024 09:54
@oxzi oxzi marked this pull request as ready for review December 18, 2024 09:54
Copy link
Member

@lippserd lippserd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything also worked well during my tests. A big thank you for the good work.

@lippserd lippserd merged commit 1fa2361 into main Dec 18, 2024
32 checks passed
@lippserd lippserd deleted the release-1.2.1 branch December 18, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants