Bug #69936 MySQL Cluster 7.3.x bundles memcached source twice -> please merge
Submitted: 6 Aug 2013 9:00 Modified: 26 Sep 2014 21:07
Reporter: Hartmut Holzgraefe Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Cluster: Memcached Severity:S2 (Serious)
Version:MySQL Cluster 7.3.1, 7.3.2, 7.4.1 OS:Linux
Assigned to: CPU Architecture:Any

[6 Aug 2013 9:00] Hartmut Holzgraefe
Description:
With Cluster 7.3 being based on MySQL 5.6 there are now two bundled versions of each memcached and libevent:

  mysql-cluster-gpl-7.3.1/plugin/innodb_memcached/daemon_memcached/
  mysql-cluster-gpl-7.3.1/storage/ndb/memcache/extra/memcached/

and

  mysql-cluster-gpl-7.3.1/libevent/
  mysql-cluster-gpl-7.3.1/storage/ndb/memcache/extra/libevent/

This looks like unnecessary duplication (copy&paste antipattern),
also the bundled versions don't seem to be the same, both differ
from original memcached 1.6beta1 code and from each other ...

How to repeat:
check source code

Suggested fix:
bundle only one version of memcached and libevent and use that version in both the innodb and ndb memcached protocol implementations ...
[6 Aug 2013 9:16] Hartmut Holzgraefe
Even worse: when enabling WITH_INNODB_MEMCACHED in 7.3.1 CMake:

CMake Error at cmake/libutils.cmake:103 (ADD_LIBRARY):
  add_library cannot create target "event" because another target with the
  same name already exists.  The existing target is a static library created
  in source directory
  "/home/hartmut/projects/mysql/releases/mysql-cluster-gpl-7.3.1/libevent".
  See documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  storage/ndb/memcache/extra/libevent/CMakeLists.txt:75 (ADD_CONVENIENCE_LIBRARY)

Building NDB Memcache using /home/hartmut/projects/mysql/releases/mysql-cluster-gpl-7.3.1/storage/ndb/memcache/extra/memcached
Using gcc atomic builtins
CMake Error at plugin/innodb_memcached/daemon_memcached/CMakeLists.txt:47 (ADD_LIBRARY):
  add_library cannot create target "memcached_utilities" because another
  target with the same name already exists.  The existing target is a static
  library created in source directory
  "/home/hartmut/projects/mysql/releases/mysql-cluster-gpl-7.3.1/storage/ndb/memcache/extra/memcached".
  See documentation for policy CMP0002 for more details.

So raising this from "S4 Feature request" to "S2 Serious"
[6 Aug 2013 11:32] Hartmut Holzgraefe
7.3.2 also affected
[8 Aug 2013 13:15] MySQL Verification Team
Hello Hartmut,

Thank you for the bug report. 
Verified as described on 7.3.2.

Thanks,
Umesh
[8 Aug 2013 13:16] MySQL Verification Team
How to repeat:

Download latest 7.3.2 source from bzr and then try to build as:

[ushastry@cluster-repo mysql-cluster-com-7.3.2]$ cmake -DCMAKE_INSTALL_PREFIX=/data/ushastry/cluster/mysql-cluster-7.3.2 -DWITH_BUNDLED_MEMCACHED=ON -DWITH_INNODB_MEMCACHED=ON

...
..
CMake Error at plugin/innodb_memcached/daemon_memcached/CMakeLists.txt:47 (ADD_LIBRARY):
  add_library cannot create target "memcached_utilities" because another
  target with the same name already exists.  The existing target is a static
  library created in source directory
  "/data/ushastry/setups/mysql-cluster-com-7.3.2/storage/ndb/memcache/extra/memcached".
  See documentation for policy CMP0002 for more details.
[26 Sep 2014 21:07] Hartmut Holzgraefe
Still the case in MySQL Cluster 7.4.1