[MDEV-32485] Upgrading spider fails after the init bug fix due to insertion of duplicate rows into mysql_func Created: 2023-10-17  Updated: 2023-12-07  Resolved: 2023-10-24

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Spider
Affects Version/s: 10.10
Fix Version/s: 10.10.7, 10.11.6, 11.0.4, 11.1.3

Type: Bug Priority: Blocker
Reporter: Yuchen Pei Assignee: Yuchen Pei
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-22979 "mysqld --bootstrap" / mysql_install_... Closed

 Description   

For example

https://buildbot.mariadb.net/buildbot/builders/kvm-deb-bullseye-amd64/builds/3107#changes-

https://buildbot.mariadb.net/buildbot/builders/kvm-deb-bullseye-amd64/builds/3107/steps/minor-upgrade-all/logs/syslog

Oct  5 21:12:36 debian-bullseye-amd64 mariadbd[10965]: [ERROR] SPIDER plugin initialization failed at 'if @win_plugin = 0 then  begin not atomic    declare exit handler for 1041, 1123      insert into mysql.func values        ('spider_direct_sql', 2, 'ha_spider.so', 'function'),        ('spider_bg_direct_sql', 2, 'ha_spider.so', 'aggregate'),        ('spider_ping_table', 2, 'ha_spider.so', 'function'),        ('spider_copy_tables', 2, 'ha_spider.so', 'function'),        ('spider_flush_table_mon_cache', 2, 'ha_spider.so', 'function');    create function if not exists spider_direct_sql returns int      soname 'ha_spider.so';    create aggregate function if not exists spider_bg_direct_sql returns int      soname 'ha_spider.so';    create function if not exists spider_ping_table returns int      soname 'ha_spider.so';    create function if not exists spider_copy_tables returns int      soname 'ha_spider.so';    create function if not exists spider_flush_table_mon_cache returns int      soname 'ha_spider.so';  end;else  begin not atomic    declare exit handler for 1041, 1123      insert into mysql.func values        ('spider_direct_sql', 2, 'ha_spider.dll', 'function'),        ('spider_bg_direct_sql', 2, 'ha_spider.dll', 'aggregate'),        ('spider_ping_table', 2, 'ha_spider.dll', 'function'),        ('spider_copy_tables', 2, 'ha_spider.dll', 'function'),        ('spider_flush_table_mon_cache', 2, 'ha_spider.dll', 'function');    create function if not exists spider_direct_sql returns int      soname 'ha_spider.dll';    create aggregate function if not exists spider_bg_direct_sql returns int      soname 'ha_spider.dll';    create function if not exists spider_ping_table returns int      soname 'ha_spider.dll';    create function if not exists spider_copy_tables returns int      soname 'ha_spider.dll';    create function if not exists spider_flush_table_mon_cache returns int      soname 'ha_spider.dll';  end;end if;' by 'Duplicate entry 'spider_direct_sql' for key 'PRIMARY''



 Comments   
Comment by Yuchen Pei [ 2023-10-17 ]

Hi holyfoot, ptal thanks

commit 7c700a5112e52432c81fbe78db22c0ac9dcaa8f8
Author: Yuchen Pei <ycp@mariadb.com>
Date:   Tue Oct 17 15:02:12 2023 +1100
 
    MDEV-32485 Fix Spider upgrade failure caused by duplication in mysql.func

Also pushed to bb-10.10-all-builders so that it can be picked up by
kvm-deb-bullseye-amd64
https://buildbot.mariadb.net/buildbot/grid?category=main&branch=bb-10.10-all-builders

Update on [2023-10-18 Wed]: the minor-upgrade-all passed, so this
patch worked:
https://buildbot.mariadb.net/buildbot/builders/kvm-deb-bullseye-amd64/builds/3136

Comment by Alexey Botchkov [ 2023-10-23 ]

ok to push.

Comment by Yuchen Pei [ 2023-10-24 ]

Thanks for the review.

Pushed 0b2fd01ed0b to 10.10

Generated at Thu Feb 08 10:31:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.