GithubHelp home page GithubHelp logo

tritondatacenter / manatee Goto Github PK

View Code? Open in Web Editor NEW
228.0 228.0 29.0 36.38 MB

Automated fault monitoring and leader-election system for strongly-consistent, highly-available writes to PostgreSQL (Joyent SDC, Manta).

License: Mozilla Public License 2.0

Makefile 2.59% JavaScript 94.90% Shell 2.51%
postgresql

manatee's People

Contributors

amlingpalantir avatar arekinath avatar bahamat avatar bixu avatar bowrocker avatar cburroughs avatar chudley avatar dwlf avatar fkuo avatar gwydirsam avatar jclulow avatar joshwilsdon avatar joyent-automation avatar kellymclaughlin avatar kusor avatar mcavage avatar melloc avatar nickziv avatar nshalman avatar rhb2 avatar sean- avatar swills avatar titanous avatar trentm avatar yunong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

manatee's Issues

manatee should support using the system postgres

Outside Triton or Manta, users of manatee should allow easy use of the system PostgreSQL install (as from pkgsrc). The default sitter.json already allows one to set paths to initdb and postgres binaries.

I propose modifying the code that determines the paths to the postgres and initdb binaries such that if the following all hold, it should return the values of pgInitDbPath and postgresPath as specified in sitter.json rather than building the paths based on pgBaseDir:

  • options.pgBaseDir is an empty string
  • options.pgInitDbPath exists
  • options.postgresPath exists

Various wrong paths and typos

Wrong smf state in backupserver.xml
Wrong default log dir in postgresql.conf
Wrong default dataDir in sitter.json

manatee hard codes postgres username

There is a config variable for the postgresql user, yet the code seems to hard code the postgres username in many places. This makes setting up manatee on systems where the username varies difficult.

postgresMgr.js null dereference

Observed in (a private branch based on) 99fd1bf "Uncaught TypeError: Cannot call method 'removeAllListeners' of null" on line analogous to line 1634 in 99fd1bf.

Admittedly we are on a private branch with other changes and it is based pretty far back in history but I believe the problem is still relevant.

Having plastered the code with debug logging and reproduced, the basic order of events is that that query error handler happens, nulls out _pgClient, and then that client error handler happens and crashes.

lib/adm.js leaks ZK clients

For complex reasons we're using adm.js in a longer lived context and so it leaking connections is actually of interest to us. My analysis of the problem is that createZkClient leaks the connection if it successfully connects, but takes longer than 10s. The logging I had to back this up showed repeatedly it hitting the timeout callback and then the connection callback for the same original call of createZkClient. The number of times this had happened matched 1:1 with the number of [apparently leaked] ESTABLISHED connections to ZK in periods of idleness.

node-gyp fails to rebuild

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node',
1 verbose cli '/usr/bin/npm',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli '[email protected]' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink /usr/bin/node
5 verbose cache add [ '[email protected]', null ]
6 verbose cache add name=undefined spec="[email protected]" args=["[email protected]",null]
7 verbose parsed url { protocol: null,
7 verbose parsed url slashes: null,
7 verbose parsed url auth: null,
7 verbose parsed url host: null,
7 verbose parsed url port: null,
7 verbose parsed url hostname: null,
7 verbose parsed url hash: null,
7 verbose parsed url search: null,
7 verbose parsed url query: null,
7 verbose parsed url pathname: '[email protected]',
7 verbose parsed url path: '[email protected]',
7 verbose parsed url href: '[email protected]' }
8 verbose cache add name="manatee" spec="0.2.1" args=["manatee","0.2.1"]
9 verbose parsed url { protocol: null,
9 verbose parsed url slashes: null,
9 verbose parsed url auth: null,
9 verbose parsed url host: null,
9 verbose parsed url port: null,
9 verbose parsed url hostname: null,
9 verbose parsed url hash: null,
9 verbose parsed url search: null,
9 verbose parsed url query: null,
9 verbose parsed url pathname: '0.2.1',
9 verbose parsed url path: '0.2.1',
9 verbose parsed url href: '0.2.1' }
10 verbose addNamed [ 'manatee', '0.2.1' ]
11 verbose addNamed [ '0.2.1', '0.2.1' ]
12 silly lockFile 4a54bef6-manatee-0-2-1 [email protected]
13 verbose lock [email protected] /home/james/.npm/4a54bef6-manatee-0-2-1.lock
14 verbose url raw manatee/0.2.1
15 verbose url resolving [ 'https://registry.npmjs.org/', './manatee/0.2.1' ]
16 verbose url resolved https://registry.npmjs.org/manatee/0.2.1
17 info trying registry request attempt 1 at 15:11:39
18 verbose etag "DS3TCVBFA08QAEUTCFXD4GF0B"
19 http GET https://registry.npmjs.org/manatee/0.2.1
20 http 304 https://registry.npmjs.org/manatee/0.2.1
21 silly registry.get cb [ 304,
21 silly registry.get { date: 'Sat, 28 Feb 2015 21:11:41 GMT',
21 silly registry.get server: 'Apache',
21 silly registry.get via: '1.1 varnish',
21 silly registry.get 'last-modified': 'Sat, 28 Feb 2015 21:11:42 GMT',
21 silly registry.get 'cache-control': 'max-age=60',
21 silly registry.get etag: '"DS3TCVBFA08QAEUTCFXD4GF0B"',
21 silly registry.get age: '0',
21 silly registry.get 'x-served-by': 'cache-dfw1826-DFW',
21 silly registry.get 'x-cache': 'MISS',
21 silly registry.get 'x-cache-hits': '0',
21 silly registry.get 'x-timer': 'S1425157901.996789,VS0,VE62',
21 silly registry.get vary: 'Accept',
21 silly registry.get 'content-length': '0',
21 silly registry.get connection: 'close' } ]
22 verbose etag manatee/0.2.1 from cache
23 silly lockFile 4a54bef6-manatee-0-2-1 [email protected]
24 silly lockFile 4a54bef6-manatee-0-2-1 [email protected]
25 silly resolved [ { name: 'manatee',
25 silly resolved version: '0.2.1',
25 silly resolved description: 'A node.js wrapper for the Manatee barcode library',
25 silly resolved main: 'index.js',
25 silly resolved scripts:
25 silly resolved { test: 'echo "Error: no test specified" && exit 1',
25 silly resolved install: 'node-gyp rebuild' },
25 silly resolved repository:
25 silly resolved { type: 'git',
25 silly resolved url: 'git://github.com/lamassu/node-manatee.git' },
25 silly resolved keywords: [ 'pdf417' ],
25 silly resolved author:
25 silly resolved { name: 'Josh Harvey',
25 silly resolved email: '[email protected]',
25 silly resolved url: 'https://lamassu.is/' },
25 silly resolved license: 'UNLICENSE',
25 silly resolved gypfile: true,
25 silly resolved bugs: { url: 'https://github.com/lamassu/node-manatee/issues' },
25 silly resolved readme: '# node-manatee\n\nA node.js wrapper for the Manatee barcode library\n\n# Build instructions\n\n1. Copy your libBarcodeScanner.a or libBarcodeScanner.so library from Manatee\nto your system library directory (e.g., /usr/local/lib).\n(You can get a demo version for free by signing up on their site.)\n2. node-gyp configure\n3. node-gyp build\n',
25 silly resolved readmeFilename: 'README.md',
25 silly resolved homepage: 'https://github.com/lamassu/node-manatee',
25 silly resolved _id: '[email protected]',
25 silly resolved _from: '[email protected]' } ]
26 info install [email protected] into /usr/lib
27 info installOne [email protected]
28 info /usr/lib/node_modules/manatee unbuild
29 verbose tar unpack /home/james/.npm/manatee/0.2.1/package.tgz
30 silly lockFile cd883a82-tar-usr-lib-node-modules-manatee tar:///usr/lib/node_modules/manatee
31 verbose lock tar:///usr/lib/node_modules/manatee /home/james/.npm/cd883a82-tar-usr-lib-node-modules-manatee.lock
32 silly lockFile 34f5c29a-es-npm-manatee-0-2-1-package-tgz tar:///home/james/.npm/manatee/0.2.1/package.tgz
33 verbose lock tar:///home/james/.npm/manatee/0.2.1/package.tgz /home/james/.npm/34f5c29a-es-npm-manatee-0-2-1-package-tgz.lock
34 silly gunzTarPerm modes [ '755', '644' ]
35 silly gunzTarPerm extractEntry package.json
36 silly gunzTarPerm extractEntry .npmignore
37 silly gunzTarPerm extractEntry README.md
38 silly gunzTarPerm extractEntry index.js
39 silly gunzTarPerm extractEntry .jshintrc
40 silly gunzTarPerm extractEntry UNLICENSE
41 silly gunzTarPerm extractEntry binding.gyp
42 silly gunzTarPerm extractEntry build/Makefile
43 silly gunzTarPerm extractEntry build/binding.Makefile
44 silly gunzTarPerm extractEntry build/config.gypi
45 silly gunzTarPerm extractEntry build/gyp-mac-tool
46 silly gunzTarPerm extractEntry build/manatee.target.mk
47 silly gunzTarPerm extractEntry src/BarcodeScanner.h
48 silly gunzTarPerm extractEntry src/manatee.cc
49 silly lockFile cd883a82-tar-usr-lib-node-modules-manatee tar:///usr/lib/node_modules/manatee
50 silly lockFile cd883a82-tar-usr-lib-node-modules-manatee tar:///usr/lib/node_modules/manatee
51 silly lockFile 34f5c29a-es-npm-manatee-0-2-1-package-tgz tar:///home/james/.npm/manatee/0.2.1/package.tgz
52 silly lockFile 34f5c29a-es-npm-manatee-0-2-1-package-tgz tar:///home/james/.npm/manatee/0.2.1/package.tgz
53 info preinstall [email protected]
54 verbose readDependencies using package.json deps
55 verbose readDependencies using package.json deps
56 silly resolved []
57 verbose about to build /usr/lib/node_modules/manatee
58 info build /usr/lib/node_modules/manatee
59 verbose linkStuff [ true, '/usr/lib/node_modules', true, '/usr/lib/node_modules' ]
60 info linkStuff [email protected]
61 verbose linkBins [email protected]
62 verbose linkMans [email protected]
63 verbose rebuildBundles [email protected]
64 info install [email protected]
65 verbose unsafe-perm in lifecycle false
66 info [email protected] Failed to exec install script
67 info /usr/lib/node_modules/manatee unbuild
68 info preuninstall [email protected]
69 info uninstall [email protected]
70 verbose true,/usr/lib/node_modules,/usr/lib/node_modules unbuild [email protected]
71 info postuninstall [email protected]
72 error [email protected] install: node-gyp rebuild
72 error Exit status 1
73 error Failed at the [email protected] install script.
73 error This is most likely a problem with the manatee package,
73 error not with npm itself.
73 error Tell the author that this fails on your system:
73 error node-gyp rebuild
73 error You can get their info via:
73 error npm owner ls manatee
73 error There is likely additional logging output above.
74 error System Linux 3.8.0-35-generic
75 error command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "[email protected]"
76 error cwd /home/james/projects/lamassu-machine
77 error node -v v0.11.10
78 error npm -v 1.3.22
79 error code ELIFECYCLE
80 verbose exit [ 1, true ]

$ node-gyp

Usage: node-gyp [options]

where is one of:
- build - Invokes make and builds the module
- clean - Removes any generated build files and the "out" dir
- configure - Generates a Makefile for the current module
- rebuild - Runs "clean", "configure" and "build" all at once
- install - Install node development files for the specified node version.
- list - Prints a listing of the currently installed node development files
- remove - Removes the node development files for the specified version

[email protected] /usr/lib/node_modules/node-gyp
[email protected]

need to bump some deps for recent versions of Node?

I'm looking into Manatee for Postgres HA at $job, and I've found I need to do this to build for Node 5 and above:

blake.irvin$ git diff
diff --git a/.gitignore b/.gitignore
index 5597b62..23c143d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@ smf/manifests/*.xml
 test/etc/zookeeperMgr.test.cfg
 abandoned
 devconfs
+.vagrant/
diff --git a/package.json b/package.json
index c49f7d2..8068e6a 100644
--- a/package.json
+++ b/package.json
@@ -21,7 +21,7 @@
     "dependencies": {
         "assert-plus": "0.1.5",
         "backoff": "1.2.0",
-        "bignum": "0.6.2",
+        "bignum": "0.11.0",
         "bunyan": "0.22.1",
         "cmdln": "3.2.0",
         "extsprintf": "1.3.0",
@@ -33,7 +33,7 @@
         "node-zookeeper-client": "0.2.1",
         "once": "1.3.0",
         "pg": "3.0.3",
-        "posix": "1.0.3",
+        "posix": "4.0.0",
         "posix-getopt": "1.0.0",
         "progbar": "0.1.0",
         "prompt": "0.2.13",

I've not yet tested these changes, but they do allow a successful npm install...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.