Uploaded image for project: 'PuppetDB'
  1. PuppetDB
  2. PDB-3857

Fix fact path GC incompatibility with Postgres 10

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PDB 5.2.0
    • Fix Version/s: PDB 5.2.7, PDB 6.0.2, PDB 6.2.0
    • Component/s: PuppetDB
    • Environment:
    • Template:
    • Team:
      PuppetDB
    • Sprint:
      Hopper/Triage
    • Method Found:
      Needs Assessment
    • Release Notes:
      Enhancement
    • Release Notes Summary:
      PuppetDB should no longer be incompatible with PostgreSQL versions 10 and newer.
    • QA Risk Assessment:
      Needs Assessment

      Description

      Puppet Version: 5.4.0
      Puppet Server Version: ---
      OS Name/Version: OpenBSD 6.2-current

      Since the update of puppetdb to 5.2.0 (prior version was 5.1.3), I see following exception every hour in the puppetdb logs, seems to have to do with regular garbage collection:

       

      2018-02-26 21:53:10,731 WARN [p.p.q.engine] The event-counts entity is experimental and may be altered or removed in the future.
      2018-02-26 21:53:45,261 INFO [p.p.c.services] Starting sweep of stale reports (threshold: 14 days)
      2018-02-26 21:53:45,280 INFO [p.p.c.services] Finished sweep of stale reports (threshold: 14 days)
      2018-02-26 21:53:45,281 INFO [p.p.c.services] Starting gc packages
      2018-02-26 21:53:45,285 INFO [p.p.c.services] Finished gc packages
      2018-02-26 21:53:45,285 INFO [p.p.c.services] Starting database garbage collection
      2018-02-26 21:53:45,334 ERROR [p.p.c.services] Error during garbage collection
      java.sql.BatchUpdateException: Batch entry 0 with recursive live_paths(key, path, value) as (select key, key as path, value from (select (jsonb_each(stable||volatile)).* from factsets) as base_case union all select sub_path as key, sub_paths.path||'#~'||sub_path as path, sub_value as value from (select * from (select path, case jsonb_typeof(value) when 'object' then (jsonb_each(value)).key when 'array' then generate_series(0, jsonb_array_length(value - 1))::text end as sub_path, case jsonb_typeof(value) when 'object' then (jsonb_each(value)).value when 'array' then jsonb_array_elements(value) end as sub_value from live_paths) as candidates where candidates.sub_path is not null) as sub_paths) delete from fact_paths fp where not exists (select 1 from live_paths where live_paths.path = fp.path) was aborted. Call getNextException to see the cause.
      {{ at org.postgresql.jdbc.BatchResultHandler.handleError(BatchResultHandler.java:133)}}
      {{ at org.postgresql.core.v3.QueryExecutorImpl$1.handleError(QueryExecutorImpl.java:419)}}
      {{ at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2004)}}
      {{ at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:360)}}
      {{ at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:1019)}}
      {{ at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:125)}}
      {{ at com.zaxxer.hikari.pool.HikariProxyStatement.executeBatch(HikariProxyStatement.java)}}
      {{ at clojure.java.jdbc$execute_batch.invokeStatic(jdbc.clj:439)}}
      {{ at clojure.java.jdbc$execute_batch.invoke(jdbc.clj:432)}}
      {{ at clojure.java.jdbc$db_do_commands$fn__21875.invoke(jdbc.clj:748)}}
      {{ at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:662)}}
      {{ at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:598)}}
      {{ at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:611)}}
      {{ at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:598)}}
      {{ at clojure.java.jdbc$db_do_commands.invokeStatic(jdbc.clj:747)}}
      {{ at clojure.java.jdbc$db_do_commands.invoke(jdbc.clj:732)}}
      {{ at puppetlabs.puppetdb.jdbc$do_commands.invokeStatic(jdbc.clj:38)}}
      {{ at puppetlabs.puppetdb.jdbc$do_commands.doInvoke(jdbc.clj:33)}}
      {{ at clojure.lang.RestFn.invoke(RestFn.java:408)}}
      {{ at puppetlabs.puppetdb.scf.storage$delete_unused_fact_paths.invokeStatic(storage.clj:1127)}}
      {{ at puppetlabs.puppetdb.scf.storage$delete_unused_fact_paths.invoke(storage.clj:1123)}}
      {{ at puppetlabs.puppetdb.scf.storage$garbage_collect_BANG_$fn_28745$fn_28748.invoke(storage.clj:1439)}}
      {{ at puppetlabs.puppetdb.jdbc$with_transacted_connection_fn$fn_22474$fn_22475.invoke(jdbc.clj:483)}}
      {{ at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:628)}}
      {{ at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:598)}}
      {{ at puppetlabs.puppetdb.jdbc$with_transacted_connection_fn$fn__22474.invoke(jdbc.clj:482)}}
      {{ at puppetlabs.puppetdb.jdbc$eval22448$retry_sql_STAR__22453$fn22454$fn_22455.invoke(jdbc.clj:454)}}
      {{ at puppetlabs.puppetdb.jdbc$eval22448$retry_sql_STAR__22453$fn_22454.invoke(jdbc.clj:453)}}
      {{ at puppetlabs.puppetdb.jdbc$eval22448$retry_sql_STAR___22453.invoke(jdbc.clj:444)}}
      {{ at puppetlabs.puppetdb.jdbc$with_transacted_connection_fn.invokeStatic(jdbc.clj:480)}}
      {{ at puppetlabs.puppetdb.jdbc$with_transacted_connection_fn.invoke(jdbc.clj:469)}}
      {{ at puppetlabs.puppetdb.scf.storage$garbage_collect_BANG_$fn__28745.invoke(storage.clj:1438)}}
      {{ at puppetlabs.puppetdb.scf.storage.proxy$java.lang.Object$Callable$7da976d4.call(Unknown Source)}}
      {{ at com.codahale.metrics.Timer.time(Timer.java:101)}}
      {{ at puppetlabs.puppetdb.scf.storage$garbage_collect_BANG_.invokeStatic(storage.clj:1432)}}
      {{ at puppetlabs.puppetdb.scf.storage$garbage_collect_BANG_.invoke(storage.clj:1429)}}
      {{ at puppetlabs.puppetdb.cli.services$garbage_collect_BANG_.invokeStatic(services.clj:189)}}
      {{ at puppetlabs.puppetdb.cli.services$garbage_collect_BANG_.invoke(services.clj:180)}}
      {{ at puppetlabs.puppetdb.cli.services$eval36422$clean_up_36427$fn36431$fn_36441.invoke(services.clj:259)}}
      {{ at puppetlabs.puppetdb.cli.services.proxy$java.lang.Object$Callable$7da976d4.call(Unknown Source)}}
      {{ at com.codahale.metrics.Timer.time(Timer.java:101)}}
      {{ at puppetlabs.puppetdb.cli.services$eval36422$clean_up_36427$fn_36431.invoke(services.clj:258)}}
      {{ at puppetlabs.puppetdb.cli.services$eval36422$clean_up__36427.invoke(services.clj:220)}}
      {{ at puppetlabs.puppetdb.cli.services$collect_garbage.invokeStatic(services.clj:373)}}
      {{ at puppetlabs.puppetdb.cli.services$collect_garbage.invoke(services.clj:368)}}
      {{ at puppetlabs.puppetdb.cli.services$start_puppetdb$fn__36498.invoke(services.clj:434)}}
      {{ at clojure.lang.AFn.run(AFn.java:22)}}
      {{ at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)}}
      {{ at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)}}
      {{ at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)}}
      {{ at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)}}
      {{ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)}}
      {{ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)}}
      {{ at java.lang.Thread.run(Thread.java:748)}}{{}}

      Desired Behavior:

      there should be no exception.

       

      Actual Behavior:

      the exception every hour.

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  rob.browning Rob Browning
                  Reporter:
                  buzzdeeeee Sebastian Reitenbach
                • Votes:
                  5 Vote for this issue
                  Watchers:
                  17 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Zendesk Support