You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "ddanielr (via GitHub)" <gi...@apache.org> on 2023/12/12 18:12:00 UTC
[PR] Make bulk import wait for in-progress bulk imports [accumulo]
ddanielr opened a new pull request, #4059:
URL: https://github.com/apache/accumulo/pull/4059
closes #4001 and adds a wait step for the bulk import to be delayed until the bulk import files are different.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make bulk import wait for in-progress bulk imports [accumulo]
Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on code in PR #4059:
URL: https://github.com/apache/accumulo/pull/4059#discussion_r1425510430
##########
server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java:
##########
@@ -1744,18 +1744,41 @@ public void importMapFiles(long tid, Map<TabletFile,MapFileInfo> fileMap, boolea
// Clients timeout and will think that this operation failed.
// Don't do it if we spent too long waiting for the lock
- long now = System.currentTimeMillis();
+ long now = System.nanoTime();
synchronized (this) {
if (isClosed()) {
throw new IOException("tablet " + extent + " is closed");
}
- // TODO check seems unneeded now - ACCUMULO-1291
- long lockWait = System.currentTimeMillis() - now;
- if (lockWait
- > getTabletServer().getConfiguration().getTimeInMillis(Property.GENERAL_RPC_TIMEOUT)) {
- throw new IOException(
- "Timeout waiting " + (lockWait / 1000.) + " seconds to get tablet lock for " + extent);
+ long rpcTimeoutNanos = TimeUnit.MILLISECONDS.toNanos(
+ (long) (getTabletServer().getConfiguration().getTimeInMillis(Property.GENERAL_RPC_TIMEOUT)
+ * 1.1));
+
+ // wait for any files that are bulk importing up to the RPC timeout limit
+ while (!Collections.disjoint(bulkImporting, fileMap.keySet())) {
+ try {
+ wait(1_000);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new IllegalStateException(e);
+ }
+
+ long lockWait = System.nanoTime() - now;
+ if (System.nanoTime() - now > rpcTimeoutNanos) {
Review Comment:
```suggestion
if (lockWait > rpcTimeoutNanos) {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make bulk import wait for in-progress bulk imports [accumulo]
Posted by "ctubbsii (via GitHub)" <gi...@apache.org>.
ctubbsii commented on code in PR #4059:
URL: https://github.com/apache/accumulo/pull/4059#discussion_r1425687103
##########
server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java:
##########
@@ -1744,18 +1744,41 @@ public void importMapFiles(long tid, Map<TabletFile,MapFileInfo> fileMap, boolea
// Clients timeout and will think that this operation failed.
// Don't do it if we spent too long waiting for the lock
- long now = System.currentTimeMillis();
+ long now = System.nanoTime();
synchronized (this) {
if (isClosed()) {
throw new IOException("tablet " + extent + " is closed");
}
- // TODO check seems unneeded now - ACCUMULO-1291
- long lockWait = System.currentTimeMillis() - now;
- if (lockWait
- > getTabletServer().getConfiguration().getTimeInMillis(Property.GENERAL_RPC_TIMEOUT)) {
- throw new IOException(
- "Timeout waiting " + (lockWait / 1000.) + " seconds to get tablet lock for " + extent);
+ long rpcTimeoutNanos = TimeUnit.MILLISECONDS.toNanos(
+ (long) (getTabletServer().getConfiguration().getTimeInMillis(Property.GENERAL_RPC_TIMEOUT)
+ * 1.1));
Review Comment:
:clap: for nanos
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make bulk import wait for in-progress bulk imports [accumulo]
Posted by "EdColeman (via GitHub)" <gi...@apache.org>.
EdColeman commented on code in PR #4059:
URL: https://github.com/apache/accumulo/pull/4059#discussion_r1424438502
##########
server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java:
##########
@@ -1744,18 +1744,41 @@ public void importMapFiles(long tid, Map<TabletFile,MapFileInfo> fileMap, boolea
// Clients timeout and will think that this operation failed.
// Don't do it if we spent too long waiting for the lock
- long now = System.currentTimeMillis();
+ long now = System.nanoTime();
synchronized (this) {
if (isClosed()) {
throw new IOException("tablet " + extent + " is closed");
}
- // TODO check seems unneeded now - ACCUMULO-1291
- long lockWait = System.currentTimeMillis() - now;
- if (lockWait
- > getTabletServer().getConfiguration().getTimeInMillis(Property.GENERAL_RPC_TIMEOUT)) {
- throw new IOException(
- "Timeout waiting " + (lockWait / 1000.) + " seconds to get tablet lock for " + extent);
+ long rpcTimeoutNanos = TimeUnit.MILLISECONDS.toNanos(
+ (long) (getTabletServer().getConfiguration().getTimeInMillis(Property.GENERAL_RPC_TIMEOUT)
+ * 1.1));
+
+ // wait for any files that are bulk importing up to the RPC timeout limit
+ while (!Collections.disjoint(bulkImporting, fileMap.keySet())) {
+ try {
+ wait(50);
Review Comment:
Would this benefit from a retry with a back-off, clamped to 500 or 1_000 ms? Maybe something like [50, 100, 200, 400, 500, 500, ....] up until the rpc timeout? This could still be responsive, but also allow some breathing room when calculating the disjoint - particularly if it is a large file set?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make bulk import wait for in-progress bulk imports [accumulo]
Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on code in PR #4059:
URL: https://github.com/apache/accumulo/pull/4059#discussion_r1425819419
##########
server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java:
##########
@@ -1744,18 +1744,41 @@ public void importMapFiles(long tid, Map<TabletFile,MapFileInfo> fileMap, boolea
// Clients timeout and will think that this operation failed.
// Don't do it if we spent too long waiting for the lock
- long now = System.currentTimeMillis();
+ long now = System.nanoTime();
synchronized (this) {
if (isClosed()) {
throw new IOException("tablet " + extent + " is closed");
}
- // TODO check seems unneeded now - ACCUMULO-1291
- long lockWait = System.currentTimeMillis() - now;
- if (lockWait
- > getTabletServer().getConfiguration().getTimeInMillis(Property.GENERAL_RPC_TIMEOUT)) {
- throw new IOException(
- "Timeout waiting " + (lockWait / 1000.) + " seconds to get tablet lock for " + extent);
+ long rpcTimeoutNanos = TimeUnit.MILLISECONDS.toNanos(
+ (long) (getTabletServer().getConfiguration().getTimeInMillis(Property.GENERAL_RPC_TIMEOUT)
+ * 1.1));
Review Comment:
This comment and the work I just did on #4067 prompted me to open #4068
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make bulk import wait for in-progress bulk imports [accumulo]
Posted by "ddanielr (via GitHub)" <gi...@apache.org>.
ddanielr commented on code in PR #4059:
URL: https://github.com/apache/accumulo/pull/4059#discussion_r1424458727
##########
server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java:
##########
@@ -1744,18 +1744,41 @@ public void importMapFiles(long tid, Map<TabletFile,MapFileInfo> fileMap, boolea
// Clients timeout and will think that this operation failed.
// Don't do it if we spent too long waiting for the lock
- long now = System.currentTimeMillis();
+ long now = System.nanoTime();
synchronized (this) {
if (isClosed()) {
throw new IOException("tablet " + extent + " is closed");
}
- // TODO check seems unneeded now - ACCUMULO-1291
- long lockWait = System.currentTimeMillis() - now;
- if (lockWait
- > getTabletServer().getConfiguration().getTimeInMillis(Property.GENERAL_RPC_TIMEOUT)) {
- throw new IOException(
- "Timeout waiting " + (lockWait / 1000.) + " seconds to get tablet lock for " + extent);
+ long rpcTimeoutNanos = TimeUnit.MILLISECONDS.toNanos(
+ (long) (getTabletServer().getConfiguration().getTimeInMillis(Property.GENERAL_RPC_TIMEOUT)
+ * 1.1));
+
+ // wait for any files that are bulk importing up to the RPC timeout limit
+ while (!Collections.disjoint(bulkImporting, fileMap.keySet())) {
+ try {
+ wait(50);
Review Comment:
That's a good point.
`GENERAL_RPC_TIMEOUT` has a default value of `120s` but it is reasonable to think that a user specified timeout would never be lower than a second, so increasing this wait to a second should be fine.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make bulk import wait for in-progress bulk imports [accumulo]
Posted by "ddanielr (via GitHub)" <gi...@apache.org>.
ddanielr merged PR #4059:
URL: https://github.com/apache/accumulo/pull/4059
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org