Based on what you've described, this is one of those situations where the venting system should be verified as a complete assembly rather than replacing sections with the same size pipe. The furnace input, water heater input, vent connector lengths, rise, offsets, common vent sizing, chimney liner, and required clearances all have to work together under the manufacturer's venting tables and local code.
The corrosion and holes in the old connector are also a sign that the previous venting system may not have been drafting correctly, so I'd be cautious about assuming the old configuration was compliant.
At Kingdom Inspections LLC, we've seen older homes where deteriorated vent connectors were symptoms of underlying draft or condensation issues rather than simply age. Before installing new vent connectors, it's worth having the entire venting system evaluated to ensure the liner, connector sizing, and appliance combination are all compatible. A properly designed venting system is critical for both efficiency and carbon monoxide safety.