1. 14 8月, 2020 1 次提交
  2. 12 8月, 2020 4 次提交
    • S
      allowTopicOperationAsync should check the original role is super user (#1355) (#7788) · 2840d6f9
      Sijie Guo 提交于
      * Fix allowTopicOperationAsync logic (#1355)
      
      *Modifications*
      
      - We should use the original role to verify if it is allowed for a given topic operation
      - use the original authentication data
      - Authz provider doesn't have to be aware of proxyRole
      - Fix authorization test
      
      * Refactor authorize logic to provide a uniform authorization behavior
      
      (cherry picked from commit 48f5a2f6)
      2840d6f9
    • S
    • J
      cpp: fix reference leak when reader create (#7793) · 255400b1
      Jia Zhai 提交于
      ### Motivation
      User reports a valgrind error for `client::createReader` method:
      
      ```
      ==23308== 284,826 (160 direct, 284,666 indirect) bytes in 1 blocks are definitely lost in loss record 113 of 113
      ==23308==    at 0x4C2A593: operator new(unsigned long) (vg_replace_malloc.c:344)
      ==23308==    by 0x5303B4A: allocate (new_allocator.h:104)
      ==23308==    by 0x5303B4A: allocate (alloc_traits.h:351)
      ==23308==    by 0x5303B4A: __shared_count<pulsar::InternalState<pulsar::Result, pulsar::Reader>, std::allocator<pulsar::InternalState<pulsar::Result, pulsar::Reader> > > (shared_ptr_base.h:499)
      ==23308==    by 0x5303B4A: __shared_ptr<std::allocator<pulsar::InternalState<pulsar::Result, pulsar::Reader> > > (shared_ptr_base.h:957)
      ==23308==    by 0x5303B4A: shared_ptr<std::allocator<pulsar::InternalState<pulsar::Result, pulsar::Reader> > > (shared_ptr.h:316)
      ==23308==    by 0x5303B4A: allocate_shared<pulsar::InternalState<pulsar::Result, pulsar::Reader>, std::allocator<pulsar::InternalState<pulsar::Result, pulsar::Reader> > > (shared_ptr.h:598)
      ==23308==    by 0x5303B4A: make_shared<pulsar::InternalState<pulsar::Result, pulsar::Reader> > (shared_ptr.h:614)
      ==23308==    by 0x5303B4A: Promise (Future.h:91)
      ==23308==    by 0x5303B4A: pulsar::Client::createReader(std::string const&, pulsar::MessageId const&, pulsar::ReaderConfiguration const&, pulsar::Reader&) (Client.cc:142)
      ==23308==    by 0x401DDB: main (pulsarReader.cpp:92)
      ==23308== 
      ```
      It seems the `ReaderImpl` has been tracked twice when call WaitForCallbackValue. this PR is to fix the issue.
      
      ### Modifications
      
      - fix WaitForCallbackValue which is changed in PR #3484.
      - add test for the reference issue.
      
      ### Verifying this change
      ut passed.
      valgrind found no issue:
      ```
      ==14758== LEAK SUMMARY:
      ==14758==    definitely lost: 0 bytes in 0 blocks
      ==14758==    indirectly lost: 0 bytes in 0 blocks
      ==14758==      possibly lost: 0 bytes in 0 blocks
      ==14758==    still reachable: 12,621 bytes in 145 blocks
      ==14758==         suppressed: 0 bytes in 0 blocks
      ==14758== 
      ==14758== For lists of detected and suppressed errors, rerun with: -s
      ==14758== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
      ```
      
      (cherry picked from commit 0e67fc59)
      255400b1
    • S
      Fix producer stucks on creating ledger timeout · e2fbf31f
      Sijie Guo 提交于
      Signed-off-by: Nxiaolong.ran <rxl@apache.org>
      e2fbf31f
  3. 11 8月, 2020 1 次提交
    • S
      Set default root log level to debug (#7789) · efa984bf
      Sijie Guo 提交于
      *Motivation*
      
      Since currently the root log level is set to info, it is not easy to turn the logging level
      to debug by running `PULSAR_LOG_LEVEL=debug bin/pulsar standalone`.
      
      (cherry picked from commit 76090c5d)
      efa984bf
  4. 10 8月, 2020 1 次提交
    • [CPP client]Fix the issue_url parsing failure in oauth2 (#7791) · f7e82885
      冉小龙 提交于
      Signed-off-by: Nxiaolong.ran <rxl@apache.org>
      
      
      ### Motivation
      
      The `issuer_url` in the current cpp example needs to be suffixed with `/oauth/token`, otherwise it cannot be recognized correctly and the following error will be returned:
      
      ```
      OAuth2 auth data: 2020-08-10 15:21:06.117 ERROR [0x10ff855c0] AuthOauth2:243 | Response failed for issuerurl https://cloud.streamnative.dev/oauth2/token. response Code 404 passedin: {
          "grant_type": "client_credentials",
          "client_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
          "client_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
          "audience": "urn:sn:pulsar:pi-ns:pi-name"
      }
      
      libc++abi.dylib: terminating with uncaught exception of type char const*
      ```
      
      
      ### Modifications
      
      Add a fixed suffix of `/oauth/token` to issuer_url
      
      ### Verifying this change
      
      Fix test cases as follows:
      
      - testOauth2CredentialFile
      - testOauth2WrongSecret
      - testOauth2
      
      (cherry picked from commit c88ba50e)
      f7e82885
  5. 06 8月, 2020 2 次提交
  6. 05 8月, 2020 8 次提交
  7. 04 8月, 2020 2 次提交
    • F
      Change some WebApplicationException log level to debug (#7725) · 67d3d986
      Fangbin Sun 提交于
      ### Motivation
      Some user may face the following `Temporary Redirect` issue when the request topic not owned by the current broker:
      ```
      19:21:48.215 [pulsar-web-42-5] ERROR org.apache.pulsar.broker.admin.impl.PersistentTopicsBase - [admin] Failed to get list of subscriptions for persistent://default_tenant/default_namespace/default_topic-partition-0
      javax.ws.rs.WebApplicationException: HTTP 307 Temporary Redirect
      	at org.apache.pulsar.broker.web.PulsarWebResource.validateTopicOwnership(PulsarWebResource.java:599)
      	at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.validateReadOperationOnTopic(PersistentTopicsBase.java:245) 
      	at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.internalGetSubscriptionsForNonPartitionedTopic(PersistentTopicsBase.java:874) 
      	at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.internalGetSubscriptions(PersistentTopicsBase.java:825) 
      	at org.apache.pulsar.broker.admin.v2.PersistentTopics.getSubscriptions(PersistentTopics.java:461)
      
      09:41:45.485 [pulsar-web-42-7] WARN  org.apache.pulsar.broker.admin.impl.PersistentTopicsBase - [admin] [persistent://public/default/test-partition-1] Failed to create subscription consumer-test at message id -1:-1:-1
      javax.ws.rs.WebApplicationException: HTTP 307 Temporary Redirect
              at org.apache.pulsar.broker.web.PulsarWebResource.validateTopicOwnership(PulsarWebResource.java:599)
              at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.validateAdminAccessForSubscriber(PersistentTopicsBase.java:283)
              at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.internalCreateSubscriptionForNonPartitionedTopic(PersistentTopicsBase.java:1752)
              at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.internalCreateSubscription(PersistentTopicsBase.java:1673)
              at org.apache.pulsar.broker.admin.v2.PersistentTopics.createSubscription(PersistentTopics.java:816)
      ```
       As discussed in https://github.com/apache/pulsar/issues/7189, it is better to use debug level when this happens.
      
      ### Modifications
      
      Change some `WebApplicationException` log level from error/warn to debug in `PersistentTopicsBase`.
      
      (cherry picked from commit 8061c547)
      67d3d986
    • L
      Close the previous reader of the healthcheck topic (#7724) · e40719f8
      lipenghui 提交于
      
      (cherry picked from commit ca98a89c)
      e40719f8
  8. 30 7月, 2020 3 次提交
    • J
      passes on authenticationData (#7694) · 7e59203c
      Joshua Decosta 提交于
      # Fixes #7693
      
      Motivation
      When trying to chase down a bug in my custom AuthenticationProvider I found that when attempting to consume a topic that I wasn't authorized on would fail to produce an unauthorized response while using the pulsar-client. I noticed that the canConsumeAsync within AuthorizationService canLookUpAsync doesn't pass along the AuthenticationDataSource when it should. My code relied on that to be passed down each time and thus my methods would never return.
      
      # Modifications
      I've added the AuthenticationDataSource to the canConsumeAsync method.
      
      (cherry picked from commit c7dc7824)
      7e59203c
    • K
      [docs] Use `minikube service` to expose ports (#7667) · 3c683a8a
      Kristi 提交于
      ### Motivation
      
      I was doing the kubernetes getting started tutorial, and got stuck when trying to connect to the pulsar-mini-proxy service. I realized I needed to run `minikube service pulsar-mini-proxy -n pulsar` in order to expose the service ports outside of minikube.
      
      Environment: OSX Catalina 10.15.3 with minikube v1.12.1 using kubernetes 1.18.3 with docker driver
      
      ### Modifications
      
      documentation update for kubernetes getting started tutorial
      Co-authored-by: NHuanliMeng <48120384+Huanli-Meng@users.noreply.github.com>
      Co-authored-by: NKristi Tsukida <ktsukida@quantcast.com>
      Co-authored-by: NHuanliMeng <48120384+Huanli-Meng@users.noreply.github.com>
      (cherry picked from commit 3b41dced)
      3c683a8a
    • L
      Fix deduplication cursor does not delete after disabling message deduplication (#7656) · 0a19dec4
      lipenghui 提交于
      ### Motivation
      
      Fix deduplication cursor does not delete after disabling message deduplication. The issue occurs when enabling the message deduplication at the broker.conf and then disable it and restart the broker. The dedup cursor will not be deleted.
      
      (cherry picked from commit 2bba620f)
      0a19dec4
  9. 29 7月, 2020 18 次提交