This is an automated email from the ASF dual-hosted git repository. zhouxj pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push: new fa9813d Revert "GEODE-5908: DiskStoreID.compare should compare mostSig, then leastSig (#2676)" fa9813d is described below commit fa9813d323f5d58c14fd4b505738f2021ec83086 Author: zhouxh <gz...@pivotal.io> AuthorDate: Thu Nov 1 09:26:43 2018 -0700 Revert "GEODE-5908: DiskStoreID.compare should compare mostSig, then leastSig (#2676)" This reverts commit ab5fafbe188de4ffb30c0ddff926a42a713da914. This fix conceptually is correct, but it somehow caused more data mismatch in concurrency conflicts handling. Since there's no found bug related with this fix, revert it for now. --- .../internal/cache/persistence/DiskStoreID.java | 2 +- .../cache/persistence/DiskStoreIDJUnitTest.java | 35 ---------------------- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/DiskStoreID.java b/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/DiskStoreID.java index 0392e92..601d248 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/DiskStoreID.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/DiskStoreID.java @@ -80,7 +80,7 @@ public class DiskStoreID implements VersionSource<DiskStoreID>, Serializable { return 1; } int result = Long.signum(mostSig - tagID.mostSig); - if (result == 0) { + if (result != 0) { result = Long.signum(leastSig - tagID.leastSig); } return result; diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/persistence/DiskStoreIDJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/persistence/DiskStoreIDJUnitTest.java deleted file mode 100644 index 4e7a703..0000000 --- a/geode-core/src/test/java/org/apache/geode/internal/cache/persistence/DiskStoreIDJUnitTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license - * agreements. See the NOTICE file distributed with this work for additional information regarding - * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the License. You may obtain a - * copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ -package org.apache.geode.internal.cache.persistence; - -import static org.apache.geode.internal.Assert.assertTrue; - -import org.junit.Test; - -public class DiskStoreIDJUnitTest { - @Test - public void biggerMostSigButSmallerLeastSigShouldBeBiggerThanSmallerMostSigButBiggerLeastSig() { - DiskStoreID diskStoreID_1 = new DiskStoreID(0x02L, 0x01L); - DiskStoreID diskStoreID_2 = new DiskStoreID(0x01L, 0x02L); - assertTrue(diskStoreID_1.compareTo(diskStoreID_2) > 0); - } - - @Test - public void diskStoreIDWithSameLeastSigShouldCompareBaseOnMostSig() { - DiskStoreID diskStoreID_1 = new DiskStoreID(0x02L, 0x01L); - DiskStoreID diskStoreID_2 = new DiskStoreID(0x01L, 0x01L); - assertTrue(diskStoreID_1.compareTo(diskStoreID_2) != 0); - } -}