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

CBG-3764 update base implementation of XDCR in rosmar #6746

Closed
wants to merge 349 commits into from
Closed

Conversation

torcolvin
Copy link
Collaborator

@torcolvin torcolvin commented Mar 28, 2024

The basic implementation of bucket to bucket XDCR should behave identically to the existing Couchbase Server implementation with -mobile=Off settings but with a manual filter expression to filter all _sync: docs except attachments.

  • define common interfaces in sg-bucket for XDCR and related structs
  • move test to use NewXDCR to allow it to run the same test with CBS or rosmar

cleanup:

  • define DataStoreName on Collection object to avoid casting (this felt better in rosmar than it does in sync gateway)

couchbaselabs/rosmar#29
couchbase/sg-bucket#117

Next steps are in CBG-3861 where the we will probably move a JSON struct for _vv and _mou to sg-bucket so it can be used in rosmar implementation. That change can go into a version of rosmar that exists in 3.2 because it will only be used in rosmar code for beryllium, and then only by test-only xdcr package in sync gateway.

Pre-review checklist

  • Removed debug logging (fmt.Print, log.Print, ...)
  • Logging sensitive data? Make sure it's tagged (e.g. base.UD(docID), base.MD(dbName))
  • Updated relevant information in the API specifications (such as endpoint descriptions, schemas, ...) in docs/api

Dependencies (if applicable)

  • Link upstream PRs
  • Update Go module dependencies when merged

Integration Tests

(Tested xdcr package with CBS 7.2, 7.6.0, 7.6.1)

bbrks and others added 30 commits August 23, 2023 09:39
* Refactor makeHandler functions to use handlerOptions

* Add /_ping API endpoint and silent handler functionality

* Add API docs for /_ping

* Publicly accessible and declare on metric router

* Add test

* Skip writing response body when request method is HEAD (RFC-9110)

* Only honor handler's requested log level if the request was successful
* Add TestRevocationsWithQueryLimit2Channels and fix loop

* Move lastSeq assignment before inner loop
* Avoid a data race on writing db.PurgeInterval during test

allow specifying PurgeInterval in DatabaseContextOptions to override
the value we might return from the server.
err was shadowed inside a goroutine, added scoping when available
* Silence metrics requests

* Lower log level of successful admin auth and 'Recording snapshot of current debug variables' message
* Pass context into Query

* Pass context into changes/channel cache

* Fix missing ctx param in test ExplainQuery

* Remove loggingCtx to force caller to pass a context and add context for test functions

* Only Flush on gocb buckets

---------

Co-authored-by: Tor Colvin <[email protected]>
Restores the 3.0.x read buffer size, to avoid memory growth in 3.1.1 associated with cbgt/import.
* Make SubdocXattrStore work with Rosmar collections

* There's a new interface sgbucket.XattrStore2 that contains the
  methods of SubdocXattrStore that aren't redundant.
* rosmar.Collection implements XattrStore2.
* LeakyDataStore now implements SubdocXattrStore; the methods are
  either delegated to their existing DataStore counterparts, or to
  the new methods from XattrStore2.
* AsSubdocXattrStore() isn't needed anymore, because LeakyDataStore
  now implements SubdocXattrStore.
* Removed obsolete TestRequiresSubdocXattrStore()
* CBG-3352 remove invalidation, just remove data from cache

* Fix fieldalignment on structs
- drop a lock by not checking the value before we remove it from the
  cache.
- switched name from Invalidate to Remove for clarity
* CBG-3292: force config update on corrupt db config
* Update XattrStore, remove subdocXattrStore

Remove subdocXattrStore (previously used to support working with multiple gocb versions), moving required functions not already included in XattrStore into XattrStore.
torcolvin and others added 8 commits March 15, 2024 13:33
* Spin master into 3.3 and continue building 4.0 on separate branch

* Bump 3.2 start build

* bump master API version

* Move most 3.2 stats to 3.3

* Change 4.0 branch name
* Update dependabot.yml to pull from private registry

* Update .github/dependabot.yml

Co-authored-by: Ben Brooks <[email protected]>

---------

Co-authored-by: Ben Brooks <[email protected]>
Bumps [github.com/gorilla/mux](https://github.com/gorilla/mux) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/gorilla/mux/releases)
- [Commits](gorilla/mux@v1.8.0...v1.8.1)

---
updated-dependencies:
- dependency-name: github.com/gorilla/mux
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.14.0 to 0.18.0.
- [Commits](golang/oauth2@v0.14.0...v0.18.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps google.golang.org/protobuf from 1.32.0 to 1.33.0.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- define common interfaces in sg-bucket for XDCR and related structs
- move test to use NewXDCR to allow it to run the same test with CBS or
  rosmar

cleanup:

- define DataStoreName on Collection object to avoid casting
Copy link

github-actions bot commented Apr 1, 2024

Redocly previews

torcolvin and others added 8 commits April 1, 2024 12:04
- xdcr tests have timing issues with creating an XDCR bucket to bucket
  replication and do not run 95% of the time.
- fix an error with defer bucket.Close() where the tests would panic
Bumps [github.com/elastic/gosigar](https://github.com/elastic/gosigar) from 0.14.2 to 0.14.3.
- [Release notes](https://github.com/elastic/gosigar/releases)
- [Changelog](https://github.com/elastic/gosigar/blob/master/CHANGELOG.md)
- [Commits](elastic/gosigar@v0.14.2...v0.14.3)

---
updated-dependencies:
- dependency-name: github.com/elastic/gosigar
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Cleanup tests

- Create TB() helper functions to make it easier to pick up the right
  TB function since it can get reset or hard to pick up
- use require.EventuallyT instead of testing.T.Fatalf to get tracebacks
  when they fail. Because these functions fail anyway, removed the
  return of boolean found.
- switch panic to require statements
- changes defaults to enabled
- update golangci-lint-action to v4 to avoid node deprecation warnings
  from action
* Combine MutationStore2, Collection, DataStoreName into DataStore

This is cleanup from the introduction to rosmar.

- rosmar.Collection and Collection already satisified the DataStoreName
interface, so putting it as part of DataStore removes need for
AsDataStoreName checks.
- remove GetFeedType() checks since it will always return DCP

- Remove StartTapFeed from leaky bucket because it was not being used.
  TestStopChangeCache was only running with xattrs disabled, but the
  test would pass even if the events arrived out of order, so the leaky
  bucket tap code was not being executed.
- Reflect in documentation that DCP feed is always used.

* Replace leaky bucket code for DCPMissingDocs
@torcolvin
Copy link
Collaborator Author

Superseded by #6761 which includes all the code in sg-bucket & rosmar into sync gateway.

Additionally this PR happened at a time when main branch was created and rebased from master, so this PR is stale in many ways.

@torcolvin torcolvin closed this Apr 9, 2024
@torcolvin torcolvin deleted the CBG-3764 branch April 9, 2024 14:31
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.

8 participants