Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121895 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 63748 invoked from network); 1 Dec 2023 11:54:04 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 1 Dec 2023 11:54:04 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 52675180058 for ; Fri, 1 Dec 2023 03:54:13 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-yw1-f179.google.com (mail-yw1-f179.google.com [209.85.128.179]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 1 Dec 2023 03:54:12 -0800 (PST) Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-5d6b9143782so1839777b3.0 for ; Fri, 01 Dec 2023 03:54:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701431643; x=1702036443; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=kmWtJLkNI2Ysl0sSPzEDRgNxT/NQxUiwlof0ayJ3PBs=; b=GsQc9YPPR6E36PSm/ciqTtXtkShYtnpy5lKhIuFLf44zMY5PMSHKoafPhamGms8B1t a3dKIA+AGArPLPsv6jFw0P5/nrwxeEltGA3MBqCMI+toss2F+bHc9rKwS+lZ3Z3VIirb NaKGQtDf06SZca6Sa4zA6wu8ZOGBCxe7GGfZCpLM2uQZ09dOrsVUrNnz24IXGRpmzi3L yBNw0gvmGO7midAGLiv1R0rtwWWWgJXLHoVGc9czsE72W3IIsJGmpQ2g81PJLMncjUNn NG+wD2v5itnZ48Pf632y6wP1NC9iupup+UartjxrzUSAQO0RtYyVET4f7mx8lXFYfsE8 hc5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701431643; x=1702036443; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kmWtJLkNI2Ysl0sSPzEDRgNxT/NQxUiwlof0ayJ3PBs=; b=eG0RVJTtZr0fAhvqBX0cvDzGfpbrIxYKPhl6WtQ2u8PeT4Ui73Z90YzEXM2ga7SjdO Qx6m7jfe+1ndyIXBPjhBMNx7Rswo9qTZ3Hk8tM3ZVESWUsjRx+S2v4r6kCrxzpYNvNg4 /8J7Xc71MHYpbvTCkLRQxoYXaWY9Qu4enW277HdD4ZVxJK8Xi+TupvnJeKh0Hq3WD3Vs v4jAte74LQ6ABYFsnKPkhAqq060O5f1LvvQIH8J3XjoAS6t+D0iAnc/aR5j/jUqx/qqx kv3LmLyK+WtJgTkAvyLip4z5Rz4BMo7QM+PbWvtygx6p9/dB8sR/ihBSU4Tr47y3shzI twGw== X-Gm-Message-State: AOJu0Yz5JvGJRsFBgRiVVVpACKbSLllDzdV9pm2tFQeHrBXdpUWOduHm lbUT9GmGaFOcSBSvAL8mLuDXIF3HifQZvE1qjVZb/QBYOXA= X-Google-Smtp-Source: AGHT+IF0WZ1RSGbRESM4yHSLXjOJs8YWeo/5MIf3ADrmHCBUtP6nPPfZOcaNhYlOueHPMVummP5HfgecQdFgoYz6EbM= X-Received: by 2002:a0d:d513:0:b0:5d3:e835:bd67 with SMTP id x19-20020a0dd513000000b005d3e835bd67mr2658938ywd.41.1701431643094; Fri, 01 Dec 2023 03:54:03 -0800 (PST) MIME-Version: 1.0 References: <6A2118D9-6DD0-4273-A2C0-A1088C05314D@sakiot.com> <6cfba3c2-c754-422f-8031-0f6046f828ac@app.fastmail.com> In-Reply-To: Date: Fri, 1 Dec 2023 13:53:55 +0200 Message-ID: To: Deleu Cc: Bruce Weirdan , php internals Content-Type: multipart/alternative; boundary="000000000000b2457d060b716cc7" Subject: Re: [PHP-DEV] [PDO] 2 phase commit From: zsidelnik@gmail.com (Eugene Sidelnyk) --000000000000b2457d060b716cc7 Content-Type: text/plain; charset="UTF-8" One thing I'd like to point out is regarding second phase (commit phase) It's important to understand that once this phase has started, there's no way back. After code execution is behind commit point, the transactions MUST commit no matter what. Data must be committed regardless of network issues even if such last for minutes. Let's say we have two databases. On the first phase we have asked them and received a confirmation of being ready to commit. Then second (Commit) phase starts: 1. We have sent commit to the first database and it responded us with OK (comitted) 2. Next we send commit to the second database, and it may be the case that in that very moment we lose connection. Hence, if connection is lost before final commit request, second database won't receive commit, and since It's not aware of whether transaction should be committed or rolled back, data is never made persistent. FWIK, this case is usually handled at the application level using async commit in message consumers. Meaning commit operation will be retied again, and again, and again until the connection is restored. Therefore, commit point is the point of no-return and network issues is the problem we have to deal with. Do you have any ideas how to handle this case at the core level in the regard of php lifecycle? --000000000000b2457d060b716cc7--