Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
CDC through connection managers
Answered: amber (hollow confidence) — Andreas showed SLA names are supported and offered a workaround wrapper for cdc_opensess, but the root cause of -83721 was never identified and the asker did not confirm.
Oyvind Gjerstad found Qlik Replicate CDC through a group of connection managers failed in cdc_opensess() with error -83721. Andreas Legner first suspected the SLA name being passed as server name, then found SLA connections are supported and asked how the sqlhosts group connect was set up. Andreas finally posted a wrapper procedure replacing cdc_opensess to pass DBSERVERNAME as a workaround. No confirmation.
💣 This thread may describe something risky to do carelessly
The workaround drops and replaces the system function informix.cdc_opensess in the syscdcv1 database, an unsupported modification of system objects.
drop function if exists informix.cdc_opensesscreate dba function informix.cdc_opensess_v1create procedure informix.cdc_opensess
Advisory only — not a substitute for testing in a non-production environment first.
Øyvind Gjerstad — source: IBM Community (ConnectedCommunity.org) Informix forum
Hi!
We have recently tested a product called QDI (or Qlik Replicate) from Qlik for consuming log data from an Informix instance through CDC. When making a direct connection to on specific server this works without issues (apart from some limitations in Informix CDC). However, since our instance is part of an HDR cluster, and we normally connect to it using a group of connection managers, we wanted to utilize the connection managers (or, at least one connection manager during the first test) for redirecting the CDC session to the current primary server.
While the connection seems to work, the first CDC api command, cdc_opensess(), fails with error code -83721:
00007348: 2021-05-19T10:41:52:602897 [SOURCE_CAPTURE ]I: Connected (informix_endpoint_esql.c:1349)
00007348: 2021-05-19T10:41:52:602897 [SOURCE_CAPTURE ]T: open cdc api session: recs per read: 256, bytes per read: 131072, poll interval: 5 (informix_endpoint_capture.c:299)
00007348: 2021-05-19T10:41:52:603896 [SOURCE_CAPTURE ]I: CDC_OPENSESS for server grp_hist_oltp Timeout 0 Max read recs 256 (informix_endpoint_esql.c:1458)
00007348: 2021-05-19T10:41:52:604895 [SOURCE_CAPTURE ]T: cdc_opensess retval = -83721 (informix_endpoint_esql.c:1487)Error in 'cdc_opensess': API retval = -83721, CDC error = 'UNKNOWN' (informix_endpoint_esql.c:1491)
It took a while before I found the meaning of this error, apparently this is
According to the API documentation the first parameter is the server name:
>>-cdc_opensess--(--"--server_name--"--,--session_ID--,--timeout--,-->
>--max_recs--,--major_version--,--minor_version--)-------------><
Now is the question, is this a problem/limitation with Informix CDC, or is it with Qlik Replicate? Have anyone utilized CDC in combination with a connection manager?
------------------------------
Øyvind Gjerstad
Developer/Architect
PostNord AS
------------------------------
#Informix
↪ replying to Øyvind Gjerstad
Andreas Legner — source: IBM Community (ConnectedCommunity.org) Informix forum
Hi Øyvind,
just stumbling over this again, realizing there's no reply yet.
That trace log presumably is from that Qlik application? And the server name it seems to be using (
grp_hist_oltp
) looks to be either an sqlhosts group name or a CM SLA name, right?
My guess is the application simply gets this name through a getenv("INFORMIXSERVER") call which would certainly be good enough in simple case, but not here.
So the application probably had to get the acutal server name to feed into cdc_opensess() through a dbinfo('servername') call.
On the other hand, looking at cdc_opensess() internally, this servername currently doesn't really serve any practical purpose and, as per a quick test, could even be an empty string (not NULL, though).
HTH,
Andreas
------------------------------
Andreas Legner
------------------------------
↪ replying to Andreas Legner
Andreas Legner — source: IBM Community (ConnectedCommunity.org) Informix forum
Eventually checked further on this, and it turns out SLA connections are well supported and the above presumed problem (SLA name passed as server name) isn't actually a problem.
Only problem I'd see is when such SLA would get you to a secondary server, but that apparently wouldn't even fail in cdc_opensess().
So any clue what might be leading to this -83721 would be highly welcome.
Reading again the initial problem description, "we normally connect to it using a
group of connection managers
", I'm wondering how this is done and whether the connection to the Connection Managers possibly is done through an sqlhosts group connect?
------------------------------
Andreas Legner
------------------------------
↪ replying to Andreas Legner
Andreas Legner — source: IBM Community (ConnectedCommunity.org) Informix forum
... and whether connecting that QDI then directly to one CM SLA would still see the problem.
------------------------------
Andreas Legner
------------------------------
↪ replying to Andreas Legner
Art Kagel — source: IBM Community (ConnectedCommunity.org) Informix forum
Andreas:
Yes, if you have more than one connection manager, which is recommended best practice, you would set up an SQLHOSTS group for the SLA listing all of the connection managers so that if one is offline the client will connect to one of the others
------------------------------
Art S. Kagel, President and Principal Consultant
ASK Database Management Corp.
www.askdbmgt.com
------------------------------
↪ replying to Andreas Legner
Andreas Legner — source: IBM Community (ConnectedCommunity.org) Informix forum
For those keen on workarounds, this would simply overwrite any server name passed into cdc_opensess() and make it work even when connecting through a group of connection managers via sqlhosts group connect:
database syscdcv1;
drop function if exists informix.cdc_opensess;create dba function informix.cdc_opensess_v1
(
informix.lvarchar, {In: servername}
informix.integer, {In: sessionid or0}
informix.integer, {In: timeoutinsecs for readcalls }
informix.integer, {In: maxnum recs for readcalls }
informix.integer, {In: interface behavior maj version}
informix.integer {In: interface behavior minversion}
)
returns informix.integer external name '(cdc_apiudr_opensess)' language C;
create procedure informix.cdc_opensess(servname lvarchar, sid int, tmo int, maxrec int, majvers int, minvers int) returning int;define myname lvarchar;
define retval integer;
select DBSERVERNAME into myname from sysmaster:sysdual;
execute function informix.cdc_opensess_v1(trim(myname), sid, tmo, maxrec, majvers, minvers) into retval;return retval;
end procedure;
------------------------------
Andreas Legner
------------------------------
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.