1. 28 8月, 2019 40 次提交
    • H
      requests should respect no_proxy env variable (#4867) · 71f351f1
      Heiss 提交于
      If you want to specify a no_proxy variable in your dockerfile or docker-compose.yml, then this little fix respects the variable in get-requests. Otherwise the proxies could break your docker namespace lookup.
      (cherry picked from commit 648f0c82)
      71f351f1
    • L
      [pulsar-sql] Handle schema not found (#4890) · 6020aae8
      lipenghui 提交于
      * Handle get schema 404 in pulsar sql(table meta and get splits)
      
      * Fix unit test.
      
      * add defaultSchema()
      
      * use Schema.BYTES.getSchemaInfo()
      
      * add unit test
      
      * rebase and fix unit tests
      
      (cherry picked from commit 2069f761)
      6020aae8
    • L
      [pulsar-sql] Make partition as internal column (#4888) · 8789f766
      lipenghui 提交于
      Fixes #4785
      
      ### Motivation
      
      1. Stop return partition name in table list, just return the partitioned topic name in table list. This will avoid huge tables while user create large number of partition.
      2. Make partition as internal column, provide users with the ability to get which partition data in and filtration based on partition. For example:
      ```
      SELECT * FROM "my-table" WHERE "__partition__" = 0;
      SELECT * FROM "my-table" WHERE "__partition__" in (2,3);
      SELECT * FROM "my-table" WHERE "__partition__" < 1;
      ```
      ### Modifications
      
      1. Add "__partition__" internal column.
      2. Add domain handle for "__partition__".
      
      ### Verifying this change
      
      Added new unit test to verify this change
      
      ### Does this pull request potentially affect one of the following parts:
      
      *If `yes` was chosen, please highlight the changes*
      
        - Dependencies (does it add or upgrade a dependency): (no)
        - The public API: (yes)
        - The schema: (no)
        - The default values of configurations: (no)
        - The wire protocol: ( no)
        - The rest endpoints: (no)
        - The admin cli options: (no)
        - Anything that affects deployment: (no)
      
      ### Documentation
      
        - Does this pull request introduce a new feature? (yes)
      
      (cherry picked from commit 5adc522e)
      8789f766
    • S
      Enforce checkstyle in the pulsar sql module (#4882) · b3397fb7
      Sergii Zhevzhyk 提交于
      The checksyle plugin was added to the pulsar sql module to enforce the defined style. All violations were fixed:
      
      - Ordering of imports.
      - Formatting of the code.
      - Absent Javadoc comments.
      - Other small issues.
      (cherry picked from commit f6fee1c6)
      b3397fb7
    • M
      Reuse ManagedLedgerFactory instances across SQL queries (#4813) · c781e405
      Matteo Merli 提交于
      (cherry picked from commit f88ea9df)
      c781e405
    • B
      add basic authentication capabilities to Pulsar SQL (#4779) · 3f6e0854
      Boyang Jerry Peng 提交于
      (cherry picked from commit 075f28b7)
      3f6e0854
    • L
      Add options to rewrite namespace delimiter for pulsar sql. (#4749) · aeb04aa5
      lipenghui 提交于
      ### Motivation
      
      Fix #4732
      
      ### Modifications
      
      Add options to rewrite the namespace delimiter, disable by default
      
      Enable rewrite namespace delimiter can work well with superset:
      <img width="1279" alt="superset" src="https://user-images.githubusercontent.com/12592133/61385412-f0f35700-a8e4-11e9-87b2-a31b62128b58.png">
      
      ### Does this pull request potentially affect one of the following parts:
      
      *If `yes` was chosen, please highlight the changes*
      
        - Dependencies (does it add or upgrade a dependency): (no)
        - The public API: (no)
        - The schema: (no)
        - The default values of configurations: (no)
        - The wire protocol: (no)
        - The rest endpoints: (no)
        - The admin cli options: (no)
        - Anything that affects deployment: (no)
      
      ### Documentation
      
        - Does this pull request introduce a new feature? (no)
      
      (cherry picked from commit 6ddd51ff)
      aeb04aa5
    • J
      produce/consume with 1 partitioned topic (#4883) · 12c59047
      Jia Zhai 提交于
      Motivation
      In PR #4764, we allow to create partitioned topic with 1 partition, But in Pulsar Client, user still not able to do it.
      This fix try to make sure user could create consumer/producer for 1 partitioned topic .
      
      Modifications
      - old and new added unit test passed.
      (cherry picked from commit 128287e3)
      12c59047
    • K
      Fix concurrent access of `uninitializedCursors` in `ManagedLedgerImpl.asyncOpenCursor` (#4837) · 553a8623
      Kezhu Wang 提交于
      ### Motivation
      Fix concurrent access of `uninitializedCursors` in `ManagedLedgerImpl.asyncOpenCursor`.
      
      ### Modifications
      * Adds test to expose concurrent access of `uninitializedCursors` in `ManagedLedgerImpl.asyncOpenCursor`.
      * Fixes concurrent access of `uninitializedCursors` in `ManagedLedgerImpl.asyncOpenCursor`.
      (cherry picked from commit 5bf319e4)
      553a8623
    • R
      Fix typo in helm chart (#4875) · 75dbd2a7
      Robert Moucha 提交于
      ### Motivation
      Incorrect value is being used in Pulsar Helm template `autorecovery-deployment.yaml`
      
      ### Modifications
      Proper variable name set.
      
      ### Verifying this change
      Fixed variable name is already set in `values.yaml` and `values-mini.yaml`.
      This change is a trivial rework / code cleanup without any test coverage.
      
      ### Documentation
      None needed.
      
      (cherry picked from commit 2b52ccb2)
      75dbd2a7
    • X
      Fix : The frist position in managedLedger is ahead of the last (#4853) · 7ec92b6d
      Xiaobing Fang 提交于
      Fixes #4852
      
      Bug:
      
      After create an empty ledger by sub/unsub and trim ledgers, the first position in managedLedger is ahead of the last when create a consumer without reopen the managed ledger.
      
      Reason:
      
      Last position will be update when opening managedLedger.
      Because when creating an empty Ledger without reopening managedLedger, the last position is not be updated. Since the ledger pointed of the last position has been deleted, the first position point to the new ledger.
      
      Fix:
      
      The first position should fall back to last position.
      (cherry picked from commit 46bfb2c2)
      7ec92b6d
    • Y
      [pulsar-io-jdbc] not set action as insert (#4862) · 2725ef3e
      Yi Tang 提交于
      ### Motivation
      
      jdbc sink treat all record as INSERT before #4358 , now it requires an indispensable action property which seems to be a break change, and we can deal records without any action property as INSERT.
      
      ### Modifications
      
      treat action not set as INSERT action like before.
      (cherry picked from commit d8356d8c)
      2725ef3e
    • L
      Catch throwable in interceptors of consumer and producer. (#4860) · ae3494d8
      lipenghui 提交于
      (cherry picked from commit 00ce7815)
      ae3494d8
    • X
      Fix : retention size policy bug (#4825) · 13c88da1
      Xiaobing Fang 提交于
      the 0 size limit can't means "infinite" size quota
      (cherry picked from commit 77f63709)
      13c88da1
    • B
      Fix: check function implements correct interface (#4844) · 50f5d7ee
      Boyang Jerry Peng 提交于
      (cherry picked from commit 3c9136b2)
      50f5d7ee
    • S
      Improve SchemaInfoProvider to fetch schema info asynchronously (#4836) · 3ef41c45
      Sijie Guo 提交于
      *Motivation*
      
      Currently fetching schema information is done synchronously.
      It is called in netty callback threads and will potentially block
      async operations.
      
      *Modifications*
      
      Make most of the operations asynchronously in SchemaInfoProvider.
      (cherry picked from commit 91c4254c)
      3ef41c45
    • X
      Fix : default retention policy in configuration do nothing (#4810) · 33a7c239
      Xiaobing Fang 提交于
      fix #4755
      Retention policy is used in Ledger GC and Topic GC.
      Default retention policy is not uploaded to zookeeper, but it is getted from zookeeper when it is used.
      So, if zookeeper doesn't have retention policy, we should load it from default config file.
      In Ledger GC configuration, it's OK.
      https://github.com/apache/pulsar/blob/075f28b71c8fd9259ce8e136dbb81c0629c3f271/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java#L739-L742
      But in Topic GC, do nothing.
      (cherry picked from commit 1dcac8cc)
      33a7c239
    • M
      Topic loading in rest-api should time out in zooKeeperOperationTimeoutSeconds (#4805) · 2b5bb183
      massakam 提交于
      (cherry picked from commit abe27e63)
      2b5bb183
    • B
      Fix: Bug when function package jar/py/go and runtime is not set (#4814) · 87b557a4
      Boyang Jerry Peng 提交于
      ### Modifications
      
      When submitting a function via REST interface, if user doesn't provide the function package or function runtime as part of function config, the function will get submitted and deployed to run but the typeClassName for the source will not be set causing a weird error in the function instance code
      (cherry picked from commit e1547e12)
      87b557a4
    • B
      Fix: Messages don't get acked if there is not sink topic (#4815) · 0f03d2a4
      Boyang Jerry Peng 提交于
      ### Motivation
      
      A message doesn't get automatically ACKed if there is the output topic is not set
      (cherry picked from commit 19b883b7)
      0f03d2a4
    • J
      upgrade git_commit_id_plugin to 3.0 (#4801) · 7a10bcdf
      Jia Zhai 提交于
      (cherry picked from commit 88c85447)
      7a10bcdf
    • C
      Pulsar SQL supports pulsar's primitive schema (#4728) · cecea0bb
      congbo 提交于
      ### Motivation
      Continue the PR of #4151
      (cherry picked from commit 1ab35b01)
      cecea0bb
    • V
      Convert anonymous classes to lambda (#4703) · 719ce139
      vzhikserg 提交于
      * Convert anonymous functions to lambda
      
      * Replacing lambda with anonymous implementation, because lambda cannot be mocked
      
      (cherry picked from commit 84364ddc)
      719ce139
    • T
      [pulsar-io][jdbc sink]Support delete and update event for JDBC Sink (#4358) · 6c6fbfd4
      tuteng 提交于
      ### Motivation
      
      Currently our JDBC Sink not support deletion and update events.
      Support for delete and update events.
      
      ### Modifications
      
      Support for delete and update events.
      Add some document for JDBC Sink. https://github.com/apache/pulsar/issues/4073
      
      ### Verifying this change
      
      local Unit Test pass.
      Integration test pass
      6c6fbfd4
    • R
      [go function] fix: go function should parse conf content first (#4746) · cb486966
      Rui Fu 提交于
      ### Motivation
      
      `pulsar-function-go/conf` package apply `instance-conf-path` with default value `HOME_PATH+github.com/apache/pulsar/pulsar-function-go/conf/conf.yaml`, once function deployed, the running node may not have the yaml conf file exist, then go function will panic with `not found conf file` error.
      
      This PR changed the logic of config parsing, parse `confContent` first, then parse `confFilePath` if `confContent` empty.
      
      (cherry picked from commit 8a3b3af6)
      cb486966
    • M
      Allow to configure ack-timeout tick time (#4760) · fe687c3c
      Matteo Merli 提交于
      ### Motivation
      
      After the changes in #3118, there has a been a sharp increase of memory utilization for the UnackedMessageTracker due to the time buckets being created.
      
      This is especially true when the acktimeout is set to a larger value (eg: 1h) where 3600 time-buckets are being created. This lead to use 20MB per partition even when no message is tracked.
      
      Allowing to configure the tick time so that application can tune it based on needs.
      
      Additionally, fixed the logic that keeps creating hash maps and throwing them away at each tick time iteration, since that creates a lot of garbage and doesn't take care of the fact that the hash maps are expanding based on the required capacity (so next time they are already of the "right" size).
      
      On a final note: the current default of 1sec seems very wasteful. Something like 10s should be more appropriate as default.
      
      (cherry picked from commit f13af487)
      fe687c3c
    • S
      [test] add getters and setters to PulsarService & BrokerService (#4709) · f14a61a4
      Sijie Guo 提交于
      *Motivation*
      
      When using PulsarService or BrokerService for testing, it might require accessing
      the components in PulsarService and BrokerService. This change is adding setters
      and getters to access the components in PulsarService & BrokerService
      (cherry picked from commit 5cff1691)
      f14a61a4
    • B
      Fix: Add kubernetes namespace to function instance url (#4701) · 34b3a947
      Boyang Jerry Peng 提交于
      ### Motivation
      
      Currently, if the kubernetes namespace set to deploy functions in is different than the one in which brokers/workers reside, get status and stats doesn't work because the url for instances does not specify the namespace.
      (cherry picked from commit 8c3445ad)
      34b3a947
    • B
      fix: add anonymous role to proxy configuration (#4733) · cdd86426
      Boyang Jerry Peng 提交于
      (cherry picked from commit 26fc4efe)
      cdd86426
    • R
      set go function executable when download to local (#4743) · b7ca1060
      Rui Fu 提交于
      ### Motivation
      
      Currently golang function needs to be compiled before deploy to pulsar, so the executable permission is required when function package is downloaded to local node from bookkeeper. This PR is intent to make golang function package executable after download from bookkeeper, to make sure the function is ok to run.
      (cherry picked from commit bf58c8eb)
      b7ca1060
    • J
      Allow to create partitioned topic with 1 partition (#4764) · 0646d274
      Jia Zhai 提交于
      **Motivation**
      when create partitioned topic, there is a check that `numPartitions > 1`, if numPartitions==1, it will fail.
      Some user may want to create partitioned topic with only 1 topic at the start time, and during using it, could update to more topics later.
      
      **Modification**
      change check of `numPartitions > 1` to `numPartitions > 0`
      
      expect all existing ut passed.
      (cherry picked from commit 5162393c)
      0646d274
    • M
      Introduce strand to C++ client for exclusive control (#4750) · 7215cd6d
      massakam 提交于
      (cherry picked from commit d8f61553)
      7215cd6d
    • C
      Add deleted schema judgment when adding schema (#4731) · 1ba26094
      congbo 提交于
      ### Motivation
      to fix #4724
      
      ### Verifying this change
      Add the tests for it
      
      (cherry picked from commit 6ec2e16b)
      1ba26094
    • Y
      add timeout to internal rest api (#4762) · 198e154e
      Yuto Furuta 提交于
      (cherry picked from commit 9605aede)
      198e154e
    • M
      Fix C++ log level names in Log4cxxLogger (#4735) · d2a4ca4f
      massakam 提交于
      ### Motivation
      
      If trying to build master C++ code with the `USE_LOG4CXX` flag turned ON, compilation errors occur:
      ```
      /tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc: In static member function ‘static log4cxx::LevelPtr pulsar::Log4CxxLogger::getLevel(pulsar::Logger::Level)’:
      /tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:53:18: error: ‘DEBUG’ was not declared in this scope
                   case DEBUG:
                        ^
      /tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:55:18: error: ‘INFO’ was not declared in this scope
                   case INFO:
                        ^
      /tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:57:18: error: ‘WARN’ was not declared in this scope
                   case WARN:
                        ^
      /tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:59:18: error: ‘ERROR’ was not declared in this scope
                   case ERROR:
                        ^
      /tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:52:16: error: enumeration value ‘LEVEL_DEBUG’ not handled in switch [-Werror=switch]
               switch (level) {
                      ^
      /tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:52:16: error: enumeration value ‘LEVEL_INFO’ not handled in switch [-Werror=switch]
      /tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:52:16: error: enumeration value ‘LEVEL_WARN’ not handled in switch [-Werror=switch]
      /tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:52:16: error: enumeration value ‘LEVEL_ERROR’ not handled in switch [-Werror=switch]
      cc1plus: some warnings being treated as errors
      make[2]: *** [lib/CMakeFiles/pulsarStatic.dir/Log4cxxLogger.cc.o] Error 1
      make[2]: *** Waiting for unfinished jobs....
      ```
      
      This is because the enum values renamed in https://github.com/apache/pulsar/pull/4664 are still used in `Log4cxxLogger.cc`.
      
      ### Modifications
      
      Fixed the enum values used in `Log4cxxLogger.cc` by adding the prefix `LEVEL_`.
      
      (cherry picked from commit af8ea71a)
      d2a4ca4f
    • [issue 4589] Fix redelivered message logic of partition topic (#4653) · 04e11bb4
      冉小龙 提交于
      Fixes #4589
      
      Motivation
      When using Partition-topic, the logic of redeliver messages will not be triggered when the time of ackTimeout arrives.
      
      This is because the unAckedMessageTrackerPtr_->add(msg.getMessageId()) is not call in the listener handling of partitioned topic in cpp code
      (cherry picked from commit cc5f25bf)
      04e11bb4
    • L
      Change type of publish_time to timestamp (#4757) · 522f715f
      lipenghui 提交于
      Fixes #4734
      
      ### Motivation
      
      "publish_time" is Pulsar SQL internal column, as Pulsar only stores timestamps, it doesn’t store the timezone information. Use timestamp as "publish_time" type is more correct way in Pulsar SQL.
      
      ### Modifications
      
      Change type of publish_time to timestamp.
      
      ### Verifying this change
      
      predicate of publish_time is pushdown
      
      Use `__publish_time__` to trim messages:
      ```
      SELECT COUNT(*)
      FROM "sql-test-1"
      WHERE "__publish_time__" >= TIMESTAMP '2019-07-18 17:26:50.119'
      AND  "__publish_time__" < TIMESTAMP '2019-07-18 17:26:51.119';
      ```
      ![image](https://user-images.githubusercontent.com/12592133/61447301-43835080-a983-11e9-814b-bc2b378f02b9.png)
      
      Without `__publish_time__` predicate:
      ```
      SELECT COUNT(*)
      FROM "sql-test-1";
      ```
      ![image](https://user-images.githubusercontent.com/12592133/61447427-82190b00-a983-11e9-8d3f-3bf2a4798047.png)
      
      (cherry picked from commit 6f5416ee)
      522f715f
    • Y
      Remove fixed server type check in kerberos client (#4758) · a5df26b9
      Yong Zhang 提交于
      ## Motivation
      
      Currently, In Pulsar Kerberos authentication, The server type part of pulsar node principle is hard coded as "broker" and "proxy". The expected principle for pulsar nodes would be like "broker/brokera.host.name@your.com" or "proxy/proxyb.host.name@your.com".
      
      But some times, user may want to re-use existing principle like "u-service/host.name@some.com", to test and play around, then "u-service" will not match service type of "broker" or "proxy", and the authentication will be rejected.
      This change is to remove the check of "broker" or "proxy" service type check.
      
      ## Modifaction
      
      Remove the check of "broker" or "proxy" service type check.
      (cherry picked from commit f5b20cd3)
      a5df26b9
    • B
      Fix: predicate pushdown for Pulsar SQL NPE (#4744) · 99c36cf9
      Boyang Jerry Peng 提交于
      * Fix: predicate pushdown for Pulsar SQL NPE
      
      * fix unit test
      
      (cherry picked from commit ac10b006)
      99c36cf9
    • Fix the problem that the log folder in pulsa-function-go is ignored by (#4736) · 88ddc066
      冉小龙 提交于
      Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>(cherry picked from commit 23dd38f3)
      88ddc066