- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit24c0a6c
committed
logical replication: fix OID type mapping mechanism
The logical replication type map seems to have been misused by its onlycaller -- it would try to use the remote OID as input for local typeroutines, which unsurprisingly could result in bogus "cache lookupfailed for type XYZ" errors, or random other type names being picked upif they happened to use the right OID. Fix that, changingOid logicalrep_typmap_getid(Oid remoteid) tochar *logicalrep_typmap_gettypname(Oid remoteid)which is more useful. If the remote type is not part of the typmap,this simply prints "unrecognized type" instead of choking trying tofigure out -- a pointless exercise (because the only input for thatcomes from replication messages, which are not under the local node'scontrol) and dangerous to boot, when called from within an error contextcallback.Once that is done, it comes to light that the local OID in the typmapentry was not being used for anything; the type/schema names are what weneed, so remove local type OID from that struct.Once you do that, it becomes pointless to attach a callback to regularsyscache invalidation. So remove that also.Reported-by: Dang Minh HuongAuthor: Masahiko SawadaReviewed-by: Álvaro Herrera, Petr Jelínek, Dang Minh Huong, Atsushi TorikoshiDiscussion:https://postgr.es/m/75DB81BEEA95B445AE6D576A0A5C9E936A6BE964@BPXM05GP.gisp.nec.co.jpDiscussion:https://postgr.es/m/75DB81BEEA95B445AE6D576A0A5C9E936A6C4B0A@BPXM05GP.gisp.nec.co.jp1 parent8df5a1c commit24c0a6c
File tree
4 files changed
+74
-88
lines changed- src
- backend/replication/logical
- include/replication
4 files changed
+74
-88
lines changedLines changed: 29 additions & 61 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
38 |
| - | |
39 |
| - | |
40 | 38 |
| |
41 | 39 |
| |
42 | 40 |
| |
| |||
115 | 113 |
| |
116 | 114 |
| |
117 | 115 |
| |
118 |
| - | |
119 |
| - | |
120 | 116 |
| |
121 | 117 |
| |
122 | 118 |
| |
| |||
375 | 371 |
| |
376 | 372 |
| |
377 | 373 |
| |
378 |
| - | |
379 |
| - | |
380 |
| - | |
381 |
| - | |
382 |
| - | |
383 |
| - | |
384 |
| - | |
385 |
| - | |
386 |
| - | |
387 |
| - | |
388 |
| - | |
389 |
| - | |
390 |
| - | |
391 |
| - | |
392 |
| - | |
393 |
| - | |
394 |
| - | |
395 |
| - | |
396 |
| - | |
397 |
| - | |
398 |
| - | |
399 | 374 |
| |
400 | 375 |
| |
401 | 376 |
| |
| |||
404 | 379 |
| |
405 | 380 |
| |
406 | 381 |
| |
407 |
| - | |
408 |
| - | |
409 | 382 |
| |
410 | 383 |
| |
411 | 384 |
| |
| |||
436 | 409 |
| |
437 | 410 |
| |
438 | 411 |
| |
439 |
| - | |
440 | 412 |
| |
441 | 413 |
| |
442 | 414 |
| |
443 |
| - | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
444 | 420 |
| |
445 |
| - | |
446 |
| - | |
| 421 | + | |
| 422 | + | |
447 | 423 |
| |
448 | 424 |
| |
449 | 425 |
| |
450 |
| - | |
451 | 426 |
| |
452 | 427 |
| |
453 | 428 |
| |
454 | 429 |
| |
455 | 430 |
| |
456 |
| - | |
457 |
| - | |
458 |
| - | |
459 |
| - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
460 | 440 |
| |
461 | 441 |
| |
462 | 442 |
| |
463 |
| - | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
464 | 452 |
| |
465 |
| - | |
| 453 | + | |
466 | 454 |
| |
467 | 455 |
| |
468 |
| - | |
469 | 456 |
| |
470 |
| - | |
471 |
| - | |
472 |
| - | |
473 |
| - | |
474 |
| - | |
475 |
| - | |
476 |
| - | |
477 |
| - | |
478 |
| - | |
479 |
| - | |
480 |
| - | |
481 |
| - | |
482 |
| - | |
483 |
| - | |
484 |
| - | |
485 |
| - | |
486 |
| - | |
487 |
| - | |
488 |
| - | |
489 |
| - | |
490 |
| - | |
| 457 | + | |
491 | 458 |
| |
492 |
| - | |
| 459 | + | |
| 460 | + | |
493 | 461 |
|
Lines changed: 41 additions & 22 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
100 | 100 |
| |
101 | 101 |
| |
102 | 102 |
| |
103 |
| - | |
104 |
| - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
105 | 106 |
| |
106 | 107 |
| |
107 | 108 |
| |
| |||
282 | 283 |
| |
283 | 284 |
| |
284 | 285 |
| |
| 286 | + | |
| 287 | + | |
285 | 288 |
| |
286 | 289 |
| |
287 | 290 |
| |
288 |
| - | |
| 291 | + | |
| 292 | + | |
289 | 293 |
| |
290 | 294 |
| |
291 |
| - | |
292 |
| - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
293 | 304 |
| |
294 | 305 |
| |
295 |
| - | |
296 |
| - | |
297 |
| - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
298 | 309 |
| |
299 | 310 |
| |
300 | 311 |
| |
| |||
315 | 326 |
| |
316 | 327 |
| |
317 | 328 |
| |
318 |
| - | |
319 |
| - | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
320 | 332 |
| |
321 | 333 |
| |
322 | 334 |
| |
| |||
334 | 346 |
| |
335 | 347 |
| |
336 | 348 |
| |
337 |
| - | |
| 349 | + | |
| 350 | + | |
338 | 351 |
| |
339 | 352 |
| |
340 |
| - | |
341 |
| - | |
342 |
| - | |
343 |
| - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
344 | 356 |
| |
| 357 | + | |
| 358 | + | |
| 359 | + | |
345 | 360 |
| |
346 | 361 |
| |
347 | 362 |
| |
| |||
380 | 395 |
| |
381 | 396 |
| |
382 | 397 |
| |
383 |
| - | |
384 |
| - | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
385 | 401 |
| |
386 | 402 |
| |
387 | 403 |
| |
| |||
404 | 420 |
| |
405 | 421 |
| |
406 | 422 |
| |
407 |
| - | |
| 423 | + | |
| 424 | + | |
408 | 425 |
| |
409 | 426 |
| |
410 |
| - | |
411 |
| - | |
412 |
| - | |
413 |
| - | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
414 | 430 |
| |
| 431 | + | |
| 432 | + | |
| 433 | + | |
415 | 434 |
| |
416 | 435 |
| |
417 | 436 |
| |
|
Lines changed: 3 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
55 | 55 |
| |
56 | 56 |
| |
57 | 57 |
| |
58 |
| - | |
59 |
| - | |
60 |
| - | |
61 |
| - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
62 | 61 |
| |
63 | 62 |
| |
64 | 63 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
40 |
| - | |
| 40 | + | |
41 | 41 |
| |
42 | 42 |
|
0 commit comments
Comments
(0)