Skip to content

Conversation

@timvaillancourt
Copy link
Contributor

@timvaillancourt timvaillancourt commented Jul 9, 2018

This PR stores the last-tailed oplog entry so that the tailer can resume from the last position in .tailQuery() properly.

.lastOplogEntry (that stored a whole oplog doc in my POC) is renamed to .lastOplogTimestamp. Storing the bson.MongoTimestamp instead of the full last oplog document (mdbstructs.Oplog) reduces memory from 16MB max (max size of an oplog doc) to a consistent 8 bytes (size of a bson.MongoTimestamp).

.lastOplogTimestamp is a pointer to bson.MongoTimestamp so that it can be checked with "if != nil".

A new struct OplogTimestampOnly was added to reduce umarshalling and GC overhead when we only need to unmarshal the "ts"/timestamp. I moved .getOplogTailTimestamp() to use this also, as it only needs the "ts" field.

@timvaillancourt timvaillancourt changed the title Store last-tailed oplog entry to the tailer can resume properly Store last-tailed oplog entry so the tailer can resume properly Jul 9, 2018
@timvaillancourt timvaillancourt changed the title Store last-tailed oplog entry so the tailer can resume properly Store last-tailed oplog timestamp so the tailer can resume properly Jul 9, 2018
@percona-csalguero percona-csalguero merged commit fb0abb7 into master Jul 10, 2018
@timvaillancourt timvaillancourt deleted the store_last_oplog_entry branch July 11, 2018 17:07
timvaillancourt added a commit that referenced this pull request Jul 18, 2018
timvaillancourt added a commit that referenced this pull request Jul 18, 2018
timvaillancourt added a commit that referenced this pull request Jul 18, 2018
* Shorten the locking in tailQuery()

* Shorten the locking in tailQuery() #2
timvaillancourt added a commit that referenced this pull request Aug 2, 2018
timvaillancourt added a commit that referenced this pull request Aug 2, 2018
timvaillancourt added a commit that referenced this pull request Aug 3, 2018
timvaillancourt added a commit that referenced this pull request Aug 6, 2018
timvaillancourt added a commit that referenced this pull request Aug 6, 2018
* add configsvr shard getter

* Test isXXXX funcs with db conn

* Test isXXXX funcs with db conn #2
timvaillancourt added a commit that referenced this pull request Aug 10, 2018
timvaillancourt added a commit that referenced this pull request Aug 10, 2018
* add structs for replsets

* Add more internal/cluster tests

* Fix tests

* Scoring WIP

* Splitting up more code

* More scorer tweaks

* more cleanup

* Add more tests

* Fix lag tests

* Cleanup code

* Add shortcut for primary

* Add more tests

* add more tests

* Throw error if compare member is nil

* fix test

* Add comments and improve scorer

* Fix scoring code

* fix scorer tests

* Check for no winner

* Rename structs + file

* Use testutils vars in test

* Use testutils vars in test #2

* Fixing tests
timvaillancourt added a commit that referenced this pull request Aug 11, 2018
* Make isMaster funcs in internal/cluster public, add IsShardsvr()

* Add balancer funcs

* Add balancer funcs, decouple funcs that used mgo.Session

* Add balancer funcs, decouple funcs that used mgo.Session #2
timvaillancourt added a commit that referenced this pull request Aug 18, 2018
timvaillancourt added a commit that referenced this pull request Aug 18, 2018
* Cleanup tests

* Func rename

* Move map->slice

* Move ShardingState to struct-methods

* Move ShardingState to struct-methods #2
timvaillancourt added a commit that referenced this pull request Aug 19, 2018
timvaillancourt added a commit that referenced this pull request Aug 19, 2018
* Add hotbackup support

* Add hotbackup support #2

* Add hotbackup support #3

* Add hotbackup support #4

* Test hotbackup

* More updates for hot backup

* Fix tests
timvaillancourt added a commit that referenced this pull request Aug 20, 2018
timvaillancourt added a commit that referenced this pull request Aug 20, 2018
* Use strings.SplitN()

* Add error var

* var rename

* var rename #2
timvaillancourt added a commit that referenced this pull request Aug 22, 2018
timvaillancourt added a commit that referenced this pull request Aug 22, 2018
* Check hot backup is supported, split up files

* Check hot backup is supported, split up files #2

* cleanup testing

* Improve testing

* Add testdata for hotbackup restore

* Add testdata for hotbackup restore

* Add-back defers

* Add restore funcs

* Add restore funcs test

* Add restore tests

* add vendor dir for globalsign/mgo

* Remove root from docker-compose.yml

* Updates

* Update mgo

* remove useless check/removeall

* Check ownership of restore+dbpath

* Check ownership of restore+dbpath #2

* Update restore test

* Use dep

* dep updates

* Fix build automation

* Building readme
timvaillancourt added a commit that referenced this pull request Aug 27, 2018
* Allow test mongodb user to read 'config'

* Add interface

* Add locking, but comment-out because it is broken

* Use ioutil.TempDir() instead of static test paths

* Use ioutil.TempDir() instead of static test paths #2

* Tweaks for hotbackup startServer()
timvaillancourt added a commit that referenced this pull request Nov 2, 2018
timvaillancourt added a commit that referenced this pull request Nov 5, 2018
timvaillancourt added a commit that referenced this pull request Nov 5, 2018
* Add funcs to find mongos using configsvr

* Fix test

* Fix test

* Fix test #2

* Fix test #3

* Move struct to mdbstructs

* Missing import

* Fix import cycle between internal/testutils/grpc-daemon.go and internal/cluster
timvaillancourt added a commit that referenced this pull request Nov 12, 2018
timvaillancourt added a commit that referenced this pull request Nov 12, 2018
* Add Dockerfile for agent/node

* Add Dockerfile for agent/node #2

* Add Dockerfile for agent/node #3

* Update agent backup dir

* Update agent backup dir
timvaillancourt added a commit that referenced this pull request Dec 11, 2018
timvaillancourt added a commit that referenced this pull request Dec 14, 2018
timvaillancourt added a commit that referenced this pull request Dec 20, 2018
timvaillancourt added a commit that referenced this pull request Dec 20, 2018
* Fix --version output, skip i386

* Rename for new repo

* Goreleaser ldflags and arch fix #2
timvaillancourt added a commit that referenced this pull request Dec 26, 2018
* Add kingpin short flags + more CLI flag cleanup

* Make 'make clean' cleanup upx tmp files

* Fix typo

* Cleanup 'make clean'

* 'server compression algorithm' -> 'server compression'
timvaillancourt added a commit that referenced this pull request Jan 10, 2019
timvaillancourt added a commit that referenced this pull request Jan 10, 2019
* Add install notes

* Add install notes #2

* Add install notes #3

* Fix ToC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants