Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(maint) Merge 2.3.1 into master (fact paths, etc.) #1331

Merged

Conversation

rbrw
Copy link
Contributor

@rbrw rbrw commented Mar 31, 2015

    (maint) Merge 2.3.1 into master (fact paths, etc.)

    * stable:
      (PDB-1328) Add contributors to and edit release notes
      (PDB-1328) Add preliminary 2.3.1 release notes
      (PDB-1031) Verify gc behavior in update race test
      (PDB-1031) Reproduce the fact paths constraint issue
      (PDB-1031) Speed migration with unique facts table
      (PDB-1031) Accommodate move of fact paths to facts
      (PDB-1031) Fix query engine, v3 endpoints for fact_path move
      (docs) Replace Checkin with Check In
      (PDB-1342) Fix trusted facts fallback
      (docs) Add .html suffixes to 2.3.0 release notes
      (PDB-1307) Update to tk-jetty 1.3.0
      (maint) applied-migrations: don't ignore exceptions

 documentation/release_notes.markdown                   |  87 +++++-
 documentation/repl.markdown                            |   3 +-
 documentation/scaling_recommendations.markdown         |   2 +-
 project.clj                                            |   2 +-
 puppet/lib/puppet/indirector/facts/puppetdb.rb         |   2 +-
 puppet/spec/unit/indirector/facts/puppetdb_spec.rb     |  25 +-
 src/puppetlabs/puppetdb/cli/services.clj               |   5 +-
 src/puppetlabs/puppetdb/facts.clj                      |  90 +++---
 src/puppetlabs/puppetdb/query.clj                      |   2 +-
 src/puppetlabs/puppetdb/query_eng/engine.clj           |  22 +-
 src/puppetlabs/puppetdb/scf/migrate.clj                | 129 +++++++--
 src/puppetlabs/puppetdb/scf/migration_legacy.clj       | 293 +++++++++++++++++++
 src/puppetlabs/puppetdb/scf/storage.clj                | 576 ++++++++++++++++++-------------------
 test/puppetlabs/puppetdb/command_test.clj              | 155 +++++++++-
 test/puppetlabs/puppetdb/facts_test.clj                |  72 -----
 test/puppetlabs/puppetdb/scf/migrate_test.clj          | 100 ++++++-
 test/puppetlabs/puppetdb/scf/migration_legacy_test.clj |  76 +++++
 test/puppetlabs/puppetdb/scf/storage_test.clj          | 157 ++++++++--
 18 files changed, 1303 insertions(+), 495 deletions(-)

rbrw and others added 19 commits March 24, 2015 12:38
Check to see if there is a schema_migrations table before querying it.
This eliminates these error messages from the postgresql log:

  STATEMENT:  SELECT version FROM schema_migrations ORDER BY version
  ERROR:  relation "schema_migrations" does not exist at character 21

A very large number of these messages are produced during the unit
tests.
The 2.3.0 release notes were missing .html extensions to some of the links. This patch
remedies that.
When adding trusted facts, a fallback mechanism is used to pull them
from the node object if there aren’t any there already. This code is
broken in puppet 4; it’s unclear whether it happened to work in puppet 3
because there was a global request object available or because this 
code was never called. In any case, the change works in both.
…update-tk-jetty

(PDB-1307) Update to tk-jetty 1.3.0
…d-migrations-without-ignoring-exceptions

(maint) applied-migrations: don't ignore exceptions
…fix-trusted-node-data

(PDB-1342) Fix trusted facts fallback
* checkin-typo:
  (docs) Replace Checkin with Check In
Change the query engine and the v3 query endpoints to handle the
migration of fact_paths from fact_values to facts.

cf. (PDB-1225)

[rlb@puppetlabs.com: remove incidental whitespace; adjust commit
 message]
Now that facts refer directly to paths:

  (factset_id fact_path_id fact_value_id)

i.e. the path_id is no longer linked to a fact_value, and the
fact_path_id column has been dropped from fact_values, and the
value_type_id has been dropped from fact_paths, adjust the code to
accommodate those changes.

Note that the new migration-baggage namespace contains code effectively
just copy-pasted from the old storage.clj (plus or minus some minor
edits).

This includes migration 28.

cf. (PDB-1224) (PDB-1225) (PDB-1226)
Copy just (factset_id, path, hash) to a temporary table and then use
that to rebuild facts once we've eliminated the duplicates from
fact_paths and fact_values.  In tests, this improved performance
substantially.

cf. (PDB-1224)

[rlb@puppetlabs.com: adjust commit message; adjust for migration
 updates]
This patch creates a unit test that recreates the following error:

update or delete on table "fact_paths" violates foreign key constraint "fact_values_path_id_fk" on table "fact_values"

[rlb@puppetlabs.com: remove demonstration output; instrument
 delete-pending-path-id-orphans! instead of delete-facts!, which is no
 longer called by replace-facts!; remove unused with-pg-test-db]
…lobal-inc-gc

(PDB-1031) Lift fact paths into facts (also PDB-1224, PDB-1225, PDB-1226, PDB-1227)
This commit adds recent contributors to the release notes for 2.3.1.
This commit also edits the description of the fact_paths issue to make
the issue more clear as well as updating the ticket links/numbers.
…328-2.3.1-release-notes

Ticket/stable/pdb 1328 2.3.1 release notes
* stable:
  (PDB-1328) Add contributors to and edit release notes
  (PDB-1328) Add preliminary 2.3.1 release notes
  (PDB-1031) Verify gc behavior in update race test
  (PDB-1031) Reproduce the fact paths constraint issue
  (PDB-1031) Speed migration with unique facts table
  (PDB-1031) Accommodate move of fact paths to facts
  (PDB-1031) Fix query engine, v3 endpoints for fact_path move
  (docs) Replace Checkin with Check In
  (PDB-1342) Fix trusted facts fallback
  (docs) Add .html suffixes to 2.3.0 release notes
  (PDB-1307) Update to tk-jetty 1.3.0
  (maint) applied-migrations: don't ignore exceptions
@rbrw rbrw added the work in progress (...and please don't merge) label Mar 31, 2015
@pljenkinsro
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/960/

@@ -302,6 +302,73 @@ derive data from a PuppetDB export tarball.

TODO
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rlb does this need to go?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wkalt perhaps not, that's a placeholder (already) in master, though I think we may eventually want to move it back up near the top where we normally put the contributors?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leave it, pre-existing & out of scope.

@wkalt
Copy link
Contributor

wkalt commented Mar 31, 2015

this looks good to me on first glance

kbarber added a commit that referenced this pull request Mar 31, 2015
…hs-etc

(maint) Merge 2.3.1 into master (fact paths, etc.)
@kbarber kbarber merged commit e571052 into puppetlabs:master Mar 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work in progress (...and please don't merge)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants