You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2022/02/14 07:29:51 UTC

[pulsar] branch branch-2.8 updated (887e0d1 -> ee1e89b)

This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a change to branch branch-2.8
in repository https://gitbox.apache.org/repos/asf/pulsar.git.


    from 887e0d1  Clean up individually deleted messages before the mark-delete position (#14261)
     new f3db1d6  Bump netty version to 4.1.74.Final (#14257)
     new ee1e89b  If mark-delete operation fails, mark the cursor as "dirty" (#14256)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 buildtools/pom.xml                                 |  2 +-
 distribution/server/src/assemble/LICENSE.bin.txt   | 40 ++++++++---------
 .../bookkeeper/mledger/impl/ManagedCursorImpl.java |  1 +
 .../bookkeeper/mledger/impl/ManagedCursorTest.java | 51 ++++++++++++++++++++++
 pom.xml                                            |  4 +-
 pulsar-sql/presto-distribution/LICENSE             | 35 ++++++++-------
 6 files changed, 94 insertions(+), 39 deletions(-)

[pulsar] 02/02: If mark-delete operation fails, mark the cursor as "dirty" (#14256)

Posted by lh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch branch-2.8
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit ee1e89ba2d9efde46e24ed32d2c70c84f87c8f0b
Author: Matteo Merli <mm...@apache.org>
AuthorDate: Sun Feb 13 03:05:52 2022 -0800

    If mark-delete operation fails, mark the cursor as "dirty" (#14256)
    
    (cherry picked from commit 8928c3496a61c588b50461d6adaab089dd421619)
---
 .../bookkeeper/mledger/impl/ManagedCursorImpl.java |  1 +
 .../bookkeeper/mledger/impl/ManagedCursorTest.java | 51 ++++++++++++++++++++++
 2 files changed, 52 insertions(+)

diff --git a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
index b775978..f9da5c9 100644
--- a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
+++ b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
@@ -1834,6 +1834,7 @@ public class ManagedCursorImpl implements ManagedCursor {
 
             @Override
             public void operationFailed(ManagedLedgerException exception) {
+                isDirty = true;
                 log.warn("[{}] Failed to mark delete position for cursor={} position={}", ledger.getName(),
                         ManagedCursorImpl.this, mdEntry.newPosition);
                 if (log.isDebugEnabled()) {
diff --git a/managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedCursorTest.java b/managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedCursorTest.java
index 84a5d66..41537d3 100644
--- a/managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedCursorTest.java
+++ b/managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedCursorTest.java
@@ -3537,6 +3537,57 @@ public class ManagedCursorTest extends MockedBookKeeperTestCase {
         assertEquals(c1.getMarkDeletedPosition(), positions.get(positions.size() -1));
     }
 
+
+
+    @Test
+    public void testFlushCursorAfterError() throws Exception {
+        ManagedLedgerConfig config = new ManagedLedgerConfig();
+        config.setThrottleMarkDelete(1.0);
+
+        ManagedLedgerFactoryConfig factoryConfig = new ManagedLedgerFactoryConfig();
+        factoryConfig.setCursorPositionFlushSeconds(1);
+
+        @Cleanup("shutdown")
+        ManagedLedgerFactory factory1 = new ManagedLedgerFactoryImpl(metadataStore, bkc, factoryConfig);
+        ManagedLedger ledger1 = factory1.open("testFlushCursorAfterInactivity", config);
+        ManagedCursor c1 = ledger1.openCursor("c");
+        List<Position> positions = new ArrayList<>();
+
+        for (int i = 0; i < 20; i++) {
+            positions.add(ledger1.addEntry(new byte[1024]));
+        }
+
+        // Simulate BK write error
+        bkc.failNow(BKException.Code.NotEnoughBookiesException);
+        metadataStore.setAlwaysFail(new MetadataStoreException.BadVersionException(""));
+
+        try {
+            c1.markDelete(positions.get(positions.size() - 1));
+            fail("should have failed");
+        } catch (ManagedLedgerException e) {
+            // Expected
+        }
+
+        metadataStore.unsetAlwaysFail();
+
+        // In memory position is updated
+        assertEquals(c1.getMarkDeletedPosition(), positions.get(positions.size() - 1));
+
+        Awaitility.await()
+                // Give chance to the flush to be automatically triggered.
+                // NOTE: this can't be set too low, or it causes issues with ZK thread pool rejecting
+                .pollDelay(Duration.ofMillis(2000))
+                .untilAsserted(() -> {
+                    // Abruptly re-open the managed ledger without graceful close
+                    @Cleanup("shutdown")
+                    ManagedLedgerFactory factory2 = new ManagedLedgerFactoryImpl(metadataStore, bkc);
+                    ManagedLedger ledger2 = factory2.open("testFlushCursorAfterInactivity", config);
+                    ManagedCursor c2 = ledger2.openCursor("c");
+
+                    assertEquals(c2.getMarkDeletedPosition(), positions.get(positions.size() - 1));
+                });
+    }
+
     @Test
     public void testCursorCheckReadPositionChanged() throws Exception {
         ManagedLedger ledger = factory.open("my_test_ledger", new ManagedLedgerConfig());

[pulsar] 01/02: Bump netty version to 4.1.74.Final (#14257)

Posted by lh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch branch-2.8
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit f3db1d672d67303d6b9841c3293f39666d92dce0
Author: ZhangJian He <sh...@gmail.com>
AuthorDate: Mon Feb 14 10:20:24 2022 +0800

    Bump netty version to 4.1.74.Final (#14257)
    
    Changelog: https://netty.io/news/2022/02/08/4-1-74-Final.html
    
    Netty 4.1.74 had solved several dns resolver bug
    
    * Upgrade Netty from 4.1.73.Final to 4.1.74.Final
    * Netty 4.1.74.Final depends on netty-tc-native 2.0.48, also updates
    
    (cherry picked from commit 949c67c69cc8cb1c74d527f8f3bcf9ce8d3b5580)
---
 buildtools/pom.xml                               |  2 +-
 distribution/server/src/assemble/LICENSE.bin.txt | 40 ++++++++++++------------
 pom.xml                                          |  4 +--
 pulsar-sql/presto-distribution/LICENSE           | 35 +++++++++++----------
 4 files changed, 42 insertions(+), 39 deletions(-)

diff --git a/buildtools/pom.xml b/buildtools/pom.xml
index 3eb2a91..58c7107 100644
--- a/buildtools/pom.xml
+++ b/buildtools/pom.xml
@@ -105,7 +105,7 @@
     <dependency>
       <groupId>io.netty</groupId>
       <artifactId>netty-common</artifactId>
-      <version>4.1.72.Final</version>
+      <version>4.1.74.Final</version>
       <scope>test</scope>
     </dependency>
   </dependencies>
diff --git a/distribution/server/src/assemble/LICENSE.bin.txt b/distribution/server/src/assemble/LICENSE.bin.txt
index 455ca83..285a048 100644
--- a/distribution/server/src/assemble/LICENSE.bin.txt
+++ b/distribution/server/src/assemble/LICENSE.bin.txt
@@ -352,26 +352,26 @@ The Apache Software License, Version 2.0
     - org.apache.commons-commons-compress-1.21.jar
     - org.apache.commons-commons-lang3-3.11.jar
  * Netty
-    - io.netty-netty-buffer-4.1.72.Final.jar
-    - io.netty-netty-codec-4.1.72.Final.jar
-    - io.netty-netty-codec-dns-4.1.72.Final.jar
-    - io.netty-netty-codec-http-4.1.72.Final.jar
-    - io.netty-netty-codec-http2-4.1.72.Final.jar
-    - io.netty-netty-codec-socks-4.1.72.Final.jar
-    - io.netty-netty-codec-haproxy-4.1.72.Final.jar
-    - io.netty-netty-common-4.1.72.Final.jar
-    - io.netty-netty-handler-4.1.72.Final.jar
-    - io.netty-netty-handler-proxy-4.1.72.Final.jar
-    - io.netty-netty-resolver-4.1.72.Final.jar
-    - io.netty-netty-resolver-dns-4.1.72.Final.jar
-    - io.netty-netty-transport-4.1.72.Final.jar
-    - io.netty-netty-transport-classes-epoll-4.1.72.Final.jar
-    - io.netty-netty-transport-native-epoll-4.1.72.Final-linux-x86_64.jar
-    - io.netty-netty-transport-native-epoll-4.1.72.Final.jar
-    - io.netty-netty-transport-native-unix-common-4.1.72.Final.jar
-    - io.netty-netty-transport-native-unix-common-4.1.72.Final-linux-x86_64.jar
-    - io.netty-netty-tcnative-boringssl-static-2.0.46.Final.jar
-    - io.netty-netty-tcnative-classes-2.0.46.Final.jar
+    - io.netty-netty-buffer-4.1.74.Final.jar
+    - io.netty-netty-codec-4.1.74.Final.jar
+    - io.netty-netty-codec-dns-4.1.74.Final.jar
+    - io.netty-netty-codec-http-4.1.74.Final.jar
+    - io.netty-netty-codec-http2-4.1.74.Final.jar
+    - io.netty-netty-codec-socks-4.1.74.Final.jar
+    - io.netty-netty-codec-haproxy-4.1.74.Final.jar
+    - io.netty-netty-common-4.1.74.Final.jar
+    - io.netty-netty-handler-4.1.74.Final.jar
+    - io.netty-netty-handler-proxy-4.1.74.Final.jar
+    - io.netty-netty-resolver-4.1.74.Final.jar
+    - io.netty-netty-resolver-dns-4.1.74.Final.jar
+    - io.netty-netty-transport-4.1.74.Final.jar
+    - io.netty-netty-transport-classes-epoll-4.1.74.Final.jar
+    - io.netty-netty-transport-native-epoll-4.1.74.Final-linux-x86_64.jar
+    - io.netty-netty-transport-native-epoll-4.1.74.Final.jar
+    - io.netty-netty-transport-native-unix-common-4.1.74.Final.jar
+    - io.netty-netty-transport-native-unix-common-4.1.74.Final-linux-x86_64.jar
+    - io.netty-netty-tcnative-boringssl-static-2.0.48.Final.jar
+    - io.netty-netty-tcnative-classes-2.0.48.Final.jar
  * Prometheus client
     - io.prometheus-simpleclient-0.5.0.jar
     - io.prometheus-simpleclient_common-0.5.0.jar
diff --git a/pom.xml b/pom.xml
index beb9732..ac4fc0c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -109,8 +109,8 @@ flexible messaging model and an intuitive client API.</description>
     <snappy.version>1.1.7</snappy.version> <!-- ZooKeeper server -->
     <dropwizardmetrics.version>3.2.5</dropwizardmetrics.version> <!-- ZooKeeper server -->
     <curator.version>5.1.0</curator.version>
-    <netty.version>4.1.72.Final</netty.version>
-    <netty-tc-native.version>2.0.46.Final</netty-tc-native.version>
+    <netty.version>4.1.74.Final</netty.version>
+    <netty-tc-native.version>2.0.48.Final</netty-tc-native.version>
     <jetty.version>9.4.43.v20210629</jetty.version>
     <conscrypt.version>2.5.2</conscrypt.version>
     <jersey.version>2.34</jersey.version>
diff --git a/pulsar-sql/presto-distribution/LICENSE b/pulsar-sql/presto-distribution/LICENSE
index 85987f8..fb0c489 100644
--- a/pulsar-sql/presto-distribution/LICENSE
+++ b/pulsar-sql/presto-distribution/LICENSE
@@ -233,23 +233,26 @@ The Apache Software License, Version 2.0
     - commons-lang3-3.11.jar
  * Netty
     - netty-3.10.6.Final.jar
-    - netty-buffer-4.1.72.Final.jar
-    - netty-codec-4.1.72.Final.jar
-    - netty-codec-dns-4.1.72.Final.jar
-    - netty-codec-http-4.1.72.Final.jar
-    - netty-codec-haproxy-4.1.72.Final.jar
-    - netty-common-4.1.72.Final.jar
-    - netty-handler-4.1.72.Final.jar
+    - netty-buffer-4.1.74.Final.jar
+    - netty-codec-4.1.74.Final.jar
+    - netty-codec-dns-4.1.74.Final.jar
+    - netty-codec-http-4.1.74.Final.jar
+    - netty-codec-haproxy-4.1.74.Final.jar
+    - netty-codec-socks-4.1.74.Final.jar
+    - netty-handler-proxy-4.1.74.Final.jar
+    - netty-common-4.1.74.Final.jar
+    - netty-handler-4.1.74.Final.jar
     - netty-reactive-streams-2.0.4.jar
-    - netty-resolver-4.1.72.Final.jar
-    - netty-resolver-dns-4.1.72.Final.jar
-    - netty-tcnative-boringssl-static-2.0.46.Final.jar
-    - netty-tcnative-classes-2.0.46.Final.jar
-    - netty-transport-4.1.72.Final.jar
-    - netty-transport-classes-epoll-4.1.72.Final.jar
-    - netty-transport-native-epoll-4.1.72.Final-linux-x86_64.jar
-    - netty-transport-native-unix-common-4.1.72.Final.jar
-    - netty-transport-native-unix-common-4.1.72.Final-linux-x86_64.jar
+    - netty-resolver-4.1.74.Final.jar
+    - netty-resolver-dns-4.1.74.Final.jar
+    - netty-tcnative-boringssl-static-2.0.48.Final.jar
+    - netty-tcnative-classes-2.0.48.Final.jar
+    - netty-transport-4.1.74.Final.jar
+    - netty-transport-classes-epoll-4.1.74.Final.jar
+    - netty-transport-native-epoll-4.1.74.Final-linux-x86_64.jar
+    - netty-transport-native-unix-common-4.1.74.Final.jar
+    - netty-transport-native-unix-common-4.1.74.Final-linux-x86_64.jar
+    - netty-codec-http2-4.1.74.Final.jar
  * Joda Time
     - joda-time-2.10.5.jar
   * Jetty