Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1slph5-001SIh-IA for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Sep 2024 13:05:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1slph3-009XGw-Sf for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Sep 2024 13:05:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1slph3-009XGo-Ho for pgsql-hackers@lists.postgresql.org; Wed, 04 Sep 2024 13:05:05 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1slph1-00075h-10 for pgsql-hackers@postgresql.org; Wed, 04 Sep 2024 13:05:04 +0000 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-71744362c22so3097988b3a.2 for ; Wed, 04 Sep 2024 06:05:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timescale.com; s=google; t=1725455102; x=1726059902; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Nnei8ZF84H0tywNlNlQgm9nbuN73bKukTsX2nkEfsK8=; b=OE/gOoNCV9w3xb5DyoIl8OWPYU8WoHVb1T20m9K1z71nv8c3Lpzvs9pNMVEXH/UTzu rfzCQuB3C9O+4R9a0qzSpVQrMb+v5TzfuRN6OqRC9ZlYZ81H01DqWhkoDGYvm/33yXMx tHRgCSyR0C6jtdUTfw6hg2wRiIuJoBQGgdJksg6ohhOeyPzosLu6G6ULI315uCFNx4Xi 8t7urwj/uUQVWPum6s1vddW939SRsE+GbTNEQdJKplZUAmnVccO3zk/DuiDRjQUS3kyG zeG45RrHf3aFSiq2At7ulRTdlutchYPCKLjlfBgl4WV8vqd4qxuf8DVy7iizhZN0ZqUW p4RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725455102; x=1726059902; 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=Nnei8ZF84H0tywNlNlQgm9nbuN73bKukTsX2nkEfsK8=; b=iMl4Ju1XiMYj2ZWXw6m49ykJCBN073AW84d4eC4MO3+FYxqpku3daPvAPikMh+XAze fgNKsqtsHL+AXaHRkI+F3FmldSnJn+GqtgjFMX2ZlmPpRCt7iEDDlGHfX1Yyc2zYlLZZ ZDlBYyEAUP46nGfuSXNOTExD0S5dvnro1r9o4iO+AiXVdqdpxaj+WH08uCGLVWQY9HNq B0z8Sdm95gC34Sd/hkUEKuFbtWc3jjkQDbLlhv8E66jKzO/C0Zbh1oUh5Lz/TJVCegi8 G21dA1WZrprq+F9Y91dT1xGiEaF/uxzpJW9eJ7V9w8qYe7unY5idYuHAjLeZ7jS6Q/Ww ReRg== X-Gm-Message-State: AOJu0YxBmILN2fgwbbjNc7rlQnnKACMGWbXCFgVltAZohxaru+LAcfvp HsyCO/2dcwsKBIPkqpA619W+YbKeAg4VOeFmHJGKirxoIK+rmOHXUb3XiLL283Sz7AaEskhvf/T VjEGxsSuQR8aM99iMzOIrDl/QXPz80LC6N1FiZsx9RblQM7fYBPk= X-Google-Smtp-Source: AGHT+IHjS9sv06KPN8H56iY2G9VHRlYXuc30wjpayYoQh1mq3iyih2YBWdqFIgajcbqwJqRNGjBBH6rYKKp+cUnMRbs= X-Received: by 2002:a05:6a00:1952:b0:714:1bce:913a with SMTP id d2e1a72fcca58-717458857a2mr13477199b3a.21.1725455101602; Wed, 04 Sep 2024 06:05:01 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Aleksander Alekseev Date: Wed, 4 Sep 2024 16:04:50 +0300 Message-ID: Subject: Re: Commit Timestamp and LSN Inversion issue To: pgsql-hackers Cc: Amit Kapila , shveta malik , "Zhijie Hou (Fujitsu)" , tomas@vondra.me Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Amit, > > I don't think you can rely on a system clock for conflict resolution. > > In a corner case a DBA can move the clock forward or backward between > > recordings of Ts1 and Ts2. On top of that there is no guarantee that > > 2+ servers have synchronised clocks. It seems to me that what you are > > proposing will just hide the problem instead of solving it in the > > general case. > > > > It is possible that we can't rely on the system clock for conflict > resolution but that is not the specific point of this thread. As > mentioned in the subject of this thread, the problem is "Commit > Timestamp and LSN Inversion issue". The LSN value and timestamp for a > commit are not generated atomically, so two different transactions can > have them in different order. Hm.... Then I'm having difficulties understanding why this is a problem and why it was necessary to mention CDR in this context in the first place. OK, let's forget about CDR completely. Who is affected by the current behavior and why would it be beneficial changing it? -- Best regards, Aleksander Alekseev