Bug 15904 - CTDB does not support PCP 7.0.0
Summary: CTDB does not support PCP 7.0.0
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: CTDB (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Jule Anger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-09-03 13:10 UTC by Alexander Bokovoy
Modified: 2025-09-26 13:52 UTC (History)
4 users (show)

See Also:


Attachments
current patch (2.08 KB, patch)
2025-09-03 13:10 UTC, Alexander Bokovoy
no flags Details
v4-23-test backport (2.70 KB, patch)
2025-09-08 08:28 UTC, Alexander Bokovoy
martins: review+
Details
additional patch for 4.23 (1.35 KB, patch)
2025-09-15 06:20 UTC, Andreas Schneider
ab: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Bokovoy 2025-09-03 13:10:46 UTC
Created attachment 18702 [details]
current patch

Fedora Rawhide got PCP 7.0.0 couple days ago, Samba does not build anymore due to it when --enable-pmda is specified.

../../ctdb/utils/pmda/pmda_ctdb.c: In function ‘pmda_ctdb_fetch’:
../../ctdb/utils/pmda/pmda_ctdb.c:475:44: error: passing argument 3 of ‘pmdaFetch’ from incompatible pointer type [-Wincompatible-pointer-types]
  475 |         ret = pmdaFetch(numpmid, pmidlist, resp, pmda);
      |                                            ^~~~
      |                                            |
      |                                            pmResult **
In file included from ../../ctdb/utils/pmda/pmda_ctdb.c:35:
/usr/include/pcp/pmda.h:571:45: note: expected ‘pmResult_v2 **’ but argument is of type ‘pmResult **’
  571 | PMDA_CALL extern int pmdaFetch(int, pmID *, pmdaResult **, pmdaExt *);
      |                                             ^
../../ctdb/utils/pmda/pmda_ctdb.c: In function ‘pmda_ctdb_init’:
../../ctdb/utils/pmda/pmda_ctdb.c:494:31: error: assignment to ‘int (*)(int,  pmID *, pmResult_v2 **, pmdaExt *)’ {aka ‘int (*)(int,  unsigned int *, pmResult_v2 **, pmdaExt *)’} from incompatible pointer type ‘int (*)(int,  pmID *, pmResult **, pmdaExt *)’ {aka ‘int (*)(int,  unsigned int *, pmResult **, pmdaExt *)’} [-Wincompatible-pointer-types]
  494 |         dp->version.two.fetch = pmda_ctdb_fetch;
      |                               ^
../../ctdb/utils/pmda/pmda_ctdb.c:453:1: note: ‘pmda_ctdb_fetch’ declared here
  453 | pmda_ctdb_fetch(int numpmid, pmID pmidlist[], pmResult **resp, pmdaExt *pmda)
      | ^~~~~~~~~~~~~~~

There are more changes needed in ctdb/wscript, I'm attaching my current patch but I haven't looked at more details, only noticed the following in PCP:

https://github.com/performancecopilot/pcp/commit/b5de2321db50741b0d34138d48faaf5c490a8755

With the attached patch I get the following reported:

Checking for header pcp/pmapi.h                 : yes 
Checking for header pcp/impl.h                  : yes 
Checking for header pcp/pmda.h                  : yes 
Checking for library pcp                        : yes 
Checking for pmProgname in pcp                  : not found 
Checking for library pcp_pmda                   : yes 
Checking for pmdaDaemon in pcp_pmda             : ok 
Checking for __pmID_int                         : not found 
Building with PMDA support

So __pmID_int was hidden and some API did change their definitions.
Comment 1 Alexander Bokovoy 2025-09-04 06:54:50 UTC
Thanks to PCP upstream developers, the only 'big' change is to use pmdaResult instead of pmResult -- this should be compatible with older releases too because pmdaResult exists for quite some time, just PCP 7.0.0 is the first release where it is not the same as pmResult.

I opened a merge request https://gitlab.com/samba-team/samba/-/merge_requests/4199 to provide a fix.
Comment 2 Samba QA Contact 2025-09-08 04:48:03 UTC
This bug was referenced in samba master:

83ff87f3dab0d6b22031614e9481b880f1dd99e8
Comment 3 Alexander Bokovoy 2025-09-08 08:28:37 UTC
Created attachment 18709 [details]
v4-23-test backport

Backport to v4-23-test
Comment 4 Martin Schwenke 2025-09-09 00:25:04 UTC
Hi Jule,

This is ready for 4.23.

Thanks!
Comment 5 Jule Anger 2025-09-09 06:50:42 UTC
Pushed to autobuild-v4-23-test.
Comment 6 Samba QA Contact 2025-09-09 12:47:04 UTC
This bug was referenced in samba v4-23-test:

1e6a3af20586fd0e7079181df6d27bcdb7ba27cd
Comment 7 Jule Anger 2025-09-11 10:26:12 UTC
Closing out bug report.

Thanks!
Comment 8 Samba QA Contact 2025-09-12 08:29:13 UTC
This bug was referenced in samba v4-23-stable (Release samba-4.23.0):

1e6a3af20586fd0e7079181df6d27bcdb7ba27cd
Comment 9 Andreas Schneider 2025-09-12 16:13:05 UTC
There is still an issue with a re-definiton. Will add a follow-up patch soon.
Comment 10 Martin Schwenke 2025-09-13 00:36:41 UTC
(In reply to Andreas Schneider from comment #9)

Hi Andreas,

What version is the problem with? I built with a couple of versions, so would just like to know what I missed...

Thanks...
Comment 11 Samba QA Contact 2025-09-13 08:13:03 UTC
This bug was referenced in samba master:

d4b448c305f674646001e293d8aa6ebc0ca6dc77
Comment 12 Andreas Schneider 2025-09-15 06:20:39 UTC
Created attachment 18726 [details]
additional patch for 4.23
Comment 13 Alexander Bokovoy 2025-09-15 07:15:53 UTC
Comment on attachment 18726 [details]
additional patch for 4.23

LGTM
Comment 14 Alexander Bokovoy 2025-09-15 07:16:45 UTC
Jule please commit the additional patch to v4.23 branches.
Comment 15 Jule Anger 2025-09-17 07:42:08 UTC
Pushed to autobuild-v4-23-test.
Comment 16 Samba QA Contact 2025-09-17 08:49:03 UTC
This bug was referenced in samba v4-23-test:

3749bc3dda3b1c7941c881f5b5269ea4b8a2d348
Comment 17 Jule Anger 2025-09-25 12:06:50 UTC
Closing out bug report.

Thanks!
Comment 18 Samba QA Contact 2025-09-26 13:52:00 UTC
This bug was referenced in samba v4-23-stable (Release samba-4.23.1):

3749bc3dda3b1c7941c881f5b5269ea4b8a2d348