mariadb use in production

42 views
Skip to first unread message

Ian Wienand

unread,
Mar 17, 2021, 1:23:17 AMMar 17
to repo-d...@googlegroups.com
Hello,

Could I kindly ask for some reviews on

https://gerrit-review.googlesource.com/c/gerrit/+/297522

which fixes the initial database creation with mariadb. We are
hitting this in CI when verifying our gerrit deployment, which starts
fresh every time [1].

After the upgrade to 3.2 the database is not doing very much. As we
are looking up upgrades for our gerrit host hardware, we are planning
on moving our production server from an externally hosted database
(ancient MySQL version) to a local mariadb container running alongside
gerrit. mariadb matches what we use in several other production
services, hence the choice.

I know the bug above affects only initial database creation, but it
also makes me think not many people are using mariadb as a db? Is
anyone using it in production? Is it a choice we are likely to
regret?

Thanks

-i

[1] This patch is tested with
https://review.opendev.org/c/opendev/system-config/+/775961

Luca Milanesio

unread,
Mar 17, 2021, 5:49:37 AMMar 17
to Ian Wienand, Luca Milanesio, repo-d...@googlegroups.com


> On 17 Mar 2021, at 05:23, Ian Wienand <iwie...@redhat.com> wrote:
>
> Hello,
>
> Could I kindly ask for some reviews on
>
> https://gerrit-review.googlesource.com/c/gerrit/+/297522

I checked the change and is ready for merge: would you need more input on it?

>
> which fixes the initial database creation with mariadb. We are
> hitting this in CI when verifying our gerrit deployment, which starts
> fresh every time [1].
>
> After the upgrade to 3.2 the database is not doing very much. As we
> are looking up upgrades for our gerrit host hardware, we are planning
> on moving our production server from an externally hosted database
> (ancient MySQL version) to a local mariadb container running alongside
> gerrit. mariadb matches what we use in several other production
> services, hence the choice.

Why not just using H2 for that?
We have tens of thousands of active daily users, 45k repositories, we do not have issues with H2 and the reviewed flag.

Luca.

> I know the bug above affects only initial database creation, but it
> also makes me think not many people are using mariadb as a db? Is
> anyone using it in production? Is it a choice we are likely to
> regret?
>
> Thanks
>
> -i
>
> [1] This patch is tested with
> https://review.opendev.org/c/opendev/system-config/+/775961
>
> --
> --
> To unsubscribe, email repo-discuss...@googlegroups.com
> More info at http://groups.google.com/group/repo-discuss?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/YFGSNx8v58Wk%2BF9n%40fedora19.localdomain.

Ian Wienand

unread,
Mar 17, 2021, 6:03:24 PMMar 17
to Luca Milanesio, repo-d...@googlegroups.com
On Wed, Mar 17, 2021 at 09:49:31AM +0000, Luca Milanesio wrote:
> > Could I kindly ask for some reviews on
> >
> > https://gerrit-review.googlesource.com/c/gerrit/+/297522

> I checked the change and is ready for merge: would you need more
> input on it?

Just merging it :) Do I need to propose ports to other branches too?

> > After the upgrade to 3.2 the database is not doing very much. As we
> > are looking up upgrades for our gerrit host hardware, we are planning
> > on moving our production server from an externally hosted database
> > (ancient MySQL version) to a local mariadb container running alongside
> > gerrit. mariadb matches what we use in several other production
> > services, hence the choice.

> Why not just using H2 for that?
> We have tens of thousands of active daily users, 45k repositories,
> we do not have issues with H2 and the reviewed flag.

The old documentation made some points about this [1], but I guess the
performance side at least is moot with NoteDB. The new documentation
says to copy the .db files [2], but I'm not sure that is actually a
consistent view? The H2 documentation says to dump it using H2 tools
[3]. We already have all the infrastructure in production to make and
monitor incremental dumps with mysqldump; not having something only
for gerrit makes one less thing to worry about :)

-i

[1] https://gerrit-documentation.storage.googleapis.com/Documentation/2.8/database-setup.html#createdb_h2
[2] https://gerrit-review.googlesource.com/Documentation/backup.html
[3] http://www.h2database.com/html/tutorial.html#upgrade_backup_restore

Luca Milanesio

unread,
Mar 17, 2021, 7:57:50 PMMar 17
to Ian Wienand, Luca Milanesio, repo-d...@googlegroups.com


> On 17 Mar 2021, at 22:03, Ian Wienand <iwie...@redhat.com> wrote:
>
> On Wed, Mar 17, 2021 at 09:49:31AM +0000, Luca Milanesio wrote:
>>> Could I kindly ask for some reviews on
>>>
>>> https://gerrit-review.googlesource.com/c/gerrit/+/297522
>
>> I checked the change and is ready for merge: would you need more
>> input on it?
>
> Just merging it :) Do I need to propose ports to other branches too?
>
>>> After the upgrade to 3.2 the database is not doing very much. As we
>>> are looking up upgrades for our gerrit host hardware, we are planning
>>> on moving our production server from an externally hosted database
>>> (ancient MySQL version) to a local mariadb container running alongside
>>> gerrit. mariadb matches what we use in several other production
>>> services, hence the choice.
>
>> Why not just using H2 for that?
>> We have tens of thousands of active daily users, 45k repositories,
>> we do not have issues with H2 and the reviewed flag.
>
> The old documentation made some points about this [1], but I guess the
> performance side at least is moot with NoteDB.

Yeah, the [1] was at the ReviewDb times, but nowadays that H2 table is used only for the reviewed flag and that is a “best-effort” thing without keeping any history of it.
When we discussed years ago about the solution, I also proposed to get rid of it altogether :-)

P.S. We do regular cleanups (e.g. getting rid of it and re-creating it from scratch) in prod and nobody ever complained about it.

> The new documentation
> says to copy the .db files [2], but I'm not sure that is actually a
> consistent view? The H2 documentation says to dump it using H2 tools
> [3]. We already have all the infrastructure in production to make and
> monitor incremental dumps with mysqldump; not having something only
> for gerrit makes one less thing to worry about :)

I wouldn’t even backup that DB because it is a temporary flag of which files the user has seen during a review session.

Luca.
Reply all
Reply to author
Forward
0 new messages