This is an automated email from the ASF dual-hosted git repository.
karan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new 6eff0e7e7d7 [Revert] Reduce number of metadata transaction retries
(#17808)
6eff0e7e7d7 is described below
commit 6eff0e7e7d7c5bafd8869aadf19c0688b5a911a8
Author: Kashif Faraz <[email protected]>
AuthorDate: Mon Mar 17 20:18:44 2025 +0530
[Revert] Reduce number of metadata transaction retries (#17808)
---
.../supervisor/SeekableStreamSupervisor.java | 2 +-
.../druid/metadata/SQLMetadataConnector.java | 24 ++++++++++++++++++----
.../metadata/SQLMetadataStorageActionHandler.java | 17 ++++-----------
.../SqlSegmentMetadataTransactionFactory.java | 4 ++--
.../cache/HeapMemorySegmentMetadataCache.java | 4 ++--
5 files changed, 29 insertions(+), 22 deletions(-)
diff --git
a/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java
b/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java
index 442dcc35f4c..daaf2529cc4 100644
---
a/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java
+++
b/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java
@@ -1010,7 +1010,7 @@ public abstract class
SeekableStreamSupervisor<PartitionIdType, SequenceOffsetTy
0,
MAX_INITIALIZATION_RETRIES,
null,
- null
+ StringUtils.format("Failed to initialize
supervisor[%s]", supervisorId)
);
}
catch (Exception e2) {
diff --git
a/server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java
b/server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java
index b7fad133657..b51739e4f35 100644
--- a/server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java
+++ b/server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java
@@ -67,7 +67,8 @@ public abstract class SQLMetadataConnector implements
MetadataStorageConnector
private static final String PAYLOAD_TYPE = "BLOB";
private static final String COLLATION = "";
- static final int DEFAULT_MAX_TRIES = 10;
+ static final int QUIET_RETRIES = 2;
+ static final int DEFAULT_MAX_TRIES = 3;
private final Supplier<MetadataStorageConnectorConfig> config;
private final Supplier<MetadataStorageTablesConfig> tablesConfigSupplier;
@@ -154,7 +155,13 @@ public abstract class SQLMetadataConnector implements
MetadataStorageConnector
)
{
try {
- return RetryUtils.retry(() -> getDBI().withHandle(callback),
myShouldRetry, DEFAULT_MAX_TRIES);
+ return RetryUtils.retry(
+ () -> getDBI().withHandle(callback),
+ myShouldRetry,
+ null,
+ DEFAULT_MAX_TRIES,
+ "Metadata transaction failed"
+ );
}
catch (Exception e) {
Throwables.propagateIfPossible(e);
@@ -170,7 +177,14 @@ public abstract class SQLMetadataConnector implements
MetadataStorageConnector
public <T> T retryTransaction(final TransactionCallback<T> callback, final
int quietTries, final int maxTries)
{
try {
- return RetryUtils.retry(() ->
getDBI().inTransaction(TransactionIsolationLevel.READ_COMMITTED, callback),
shouldRetry, quietTries, maxTries);
+ return RetryUtils.retry(
+ () ->
getDBI().inTransaction(TransactionIsolationLevel.READ_COMMITTED, callback),
+ shouldRetry,
+ quietTries,
+ maxTries,
+ null,
+ "Metadata write transaction failed"
+ );
}
catch (Exception e) {
Throwables.propagateIfPossible(e);
@@ -897,7 +911,9 @@ public abstract class SQLMetadataConnector implements
MetadataStorageConnector
() ->
getDBI().inTransaction(TransactionIsolationLevel.READ_COMMITTED, callback),
shouldRetry,
quietTries,
- maxTries
+ maxTries,
+ null,
+ "Metadata read transaction failed"
);
}
catch (Exception e) {
diff --git
a/server/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java
b/server/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java
index 910e2e1b163..f8c506d71da 100644
---
a/server/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java
+++
b/server/src/main/java/org/apache/druid/metadata/SQLMetadataStorageActionHandler.java
@@ -377,7 +377,7 @@ public abstract class
SQLMetadataStorageActionHandler<EntryType, StatusType, Log
}
return tasks;
},
- 3,
+ SQLMetadataConnector.QUIET_RETRIES,
SQLMetadataConnector.DEFAULT_MAX_TRIES
);
}
@@ -436,7 +436,7 @@ public abstract class
SQLMetadataStorageActionHandler<EntryType, StatusType, Log
}
return taskMetadataInfos;
},
- 3,
+ SQLMetadataConnector.QUIET_RETRIES,
SQLMetadataConnector.DEFAULT_MAX_TRIES
);
}
@@ -840,7 +840,7 @@ public abstract class
SQLMetadataStorageActionHandler<EntryType, StatusType, Log
return addLock(handle, entryId, newLock);
},
- 3,
+ SQLMetadataConnector.QUIET_RETRIES,
SQLMetadataConnector.DEFAULT_MAX_TRIES
);
}
@@ -849,16 +849,7 @@ public abstract class
SQLMetadataStorageActionHandler<EntryType, StatusType, Log
public void removeLock(final long lockId)
{
connector.retryWithHandle(
- new HandleCallback<Void>()
- {
- @Override
- public Void withHandle(Handle handle)
- {
- removeLock(handle, lockId);
-
- return null;
- }
- }
+ handle -> removeLock(handle, lockId)
);
}
diff --git
a/server/src/main/java/org/apache/druid/metadata/segment/SqlSegmentMetadataTransactionFactory.java
b/server/src/main/java/org/apache/druid/metadata/segment/SqlSegmentMetadataTransactionFactory.java
index 612f888ff8e..5a6adbdf8ff 100644
---
a/server/src/main/java/org/apache/druid/metadata/segment/SqlSegmentMetadataTransactionFactory.java
+++
b/server/src/main/java/org/apache/druid/metadata/segment/SqlSegmentMetadataTransactionFactory.java
@@ -40,8 +40,8 @@ import org.skife.jdbi.v2.TransactionStatus;
*/
public class SqlSegmentMetadataTransactionFactory implements
SegmentMetadataTransactionFactory
{
- private static final int QUIET_RETRIES = 3;
- private static final int MAX_RETRIES = 10;
+ private static final int QUIET_RETRIES = 2;
+ private static final int MAX_RETRIES = 3;
private final ObjectMapper jsonMapper;
private final MetadataStorageTablesConfig tablesConfig;
diff --git
a/server/src/main/java/org/apache/druid/metadata/segment/cache/HeapMemorySegmentMetadataCache.java
b/server/src/main/java/org/apache/druid/metadata/segment/cache/HeapMemorySegmentMetadataCache.java
index 65482e41046..2d177509547 100644
---
a/server/src/main/java/org/apache/druid/metadata/segment/cache/HeapMemorySegmentMetadataCache.java
+++
b/server/src/main/java/org/apache/druid/metadata/segment/cache/HeapMemorySegmentMetadataCache.java
@@ -73,8 +73,8 @@ public class HeapMemorySegmentMetadataCache implements
SegmentMetadataCache
{
private static final EmittingLogger log = new
EmittingLogger(HeapMemorySegmentMetadataCache.class);
- private static final int SQL_MAX_RETRIES = 10;
- private static final int SQL_QUIET_RETRIES = 3;
+ private static final int SQL_MAX_RETRIES = 3;
+ private static final int SQL_QUIET_RETRIES = 2;
/**
* Maximum time to wait for cache to be ready.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]