HBASE-27046 The filenum in AbstractFSWAL should be monotone increasing (#4449)

Signed-off-by: Xin Sun <ddupgs@gmail.com>
Signed-off-by: GeorryHuang <huangzhuoyue@apache.org>
(cherry picked from commit 313a37f7ac)
This commit is contained in:
Duo Zhang 2022-06-02 23:55:23 +08:00
parent df9739979e
commit 9ea3e39d7a
3 changed files with 1 additions and 9 deletions

View File

@ -571,12 +571,8 @@ public abstract class AbstractFSWAL<W extends WriterBase> implements WAL {
* retrieve the next path to use for writing. Increments the internal filenum.
*/
private Path getNewPath() throws IOException {
this.filenum.set(System.currentTimeMillis());
this.filenum.set(Math.max(getFilenum() + 1, System.currentTimeMillis()));
Path newPath = getCurrentFileName();
while (fs.exists(newPath)) {
this.filenum.incrementAndGet();
newPath = getCurrentFileName();
}
return newPath;
}

View File

@ -43,11 +43,9 @@ import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;
@Ignore // disable for now, see HBASE-27045
@Category({ RegionServerTests.class, LargeTests.class })
public class TestClusterScopeQuotaThrottle {

View File

@ -44,13 +44,11 @@ import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Ignore // Disabled because flakey. Fails ~30% on a resource constrained GCE though not on Apache.
@Category({ RegionServerTests.class, MediumTests.class })
public class TestQuotaThrottle {