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

server: move sqlServer to new file #47509

Merged
merged 1 commit into from
Apr 16, 2020
Merged

server: move sqlServer to new file #47509

merged 1 commit into from
Apr 16, 2020

Conversation

tbg
Copy link
Member

@tbg tbg commented Apr 15, 2020

This is pure code movement. Next step will be untangling
(*Server).Start to contain an explicit call to (*sqlServer).start()
(a method which does not exist today).

I'm intentionally not documenting the various inputs to sqlServer yet
in anticipation of larger changes to them.

Release note: None

This is pure code movement. Next step will be untangling
`(*Server).Start` to contain an explicit call to `(*sqlServer).start()`
(a method which does not exist today).

I'm intentionally not documenting the various inputs to `sqlServer` yet
in anticipation of larger changes to them.

Release note: None
@tbg tbg requested a review from andreimatei April 15, 2020 12:13
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@andreimatei andreimatei left a comment

Choose a reason for hiding this comment

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

LGTM

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @andreimatei and @nvanbenschoten)

@tbg
Copy link
Member Author

tbg commented Apr 16, 2020

bors r=andreimatei

@craig
Copy link
Contributor

craig bot commented Apr 16, 2020

Build succeeded

@craig craig bot merged commit 71cccb2 into cockroachdb:master Apr 16, 2020
@tbg tbg deleted the sqlserver branch April 16, 2020 14:45
craig bot pushed a commit that referenced this pull request Apr 16, 2020
47331: storage_test: test incremental iteration via ExportToSST r=dt a=dt

TestMVCCIncrementalIterator used to serve as one of our primary unit
tests on incremental iteration. However with the introduction of the c++
implementation of an incremental iterator, the fact that it directly
tests the Go iterator leaves the parallel implementation (that is used
by default at runtime) untested.

This change extends the test to also verify each test case via
engine.ExportToSST, which, because it lets the engine in use decide
which iterator to use, means that it now tests both iterators.
Additionally this serves to actually test that the usage of those
iterators yields the expected results at the same time.

Futhermore, both of these iterators behave differently when the min/max
timestamp hints are provided, when they use a second filtered
(time-bound) iterator to skip keys. Previously this test never set these
hints, and thus never exercise the TBI path in either iterator. Not
however that even with this hint set and the pair of iterators being
used, this test still only covers a fraction of the TBI code, as the
handful of keys used in each test never get flushed, much less into
separate SSTs with different time-bounds, so all of the logic around
Seeking over large swaths of keys, catching up in the known edges cases,
etc is still uncovered.

Release note: none.

47517: server: extract (*sqlServer).start r=andreimatei a=tbg

First commit is #47509, don't review here.

Co-authored-by: David Taylor <[email protected]>
Co-authored-by: Tobias Schottdorf <[email protected]>
nvanbenschoten added a commit to nvanbenschoten/cockroach that referenced this pull request Apr 20, 2020
nvanbenschoten added a commit to nvanbenschoten/cockroach that referenced this pull request Apr 22, 2020
craig bot pushed a commit that referenced this pull request Apr 22, 2020
47616: kv/concurrency: remove TODO about impossible deadlock scenario r=nvanbenschoten a=nvanbenschoten

This commit removes a TODO that described a potential scenario in which a request-only dependency cycle could deadlock due to a simultaneous transaction abort. I realized after writing a full fix (9a9182f) that such a deadlock was not achievable in practice due to the semantics of the lockTable.

> It may appear that there is a bug here in the handling of request-only
> dependency cycles. If such a cycle was broken by simultaneously aborting
> the transactions responsible for each of the request, there would be no
> guarantee that an aborted pusher would notice that its own transaction
> was aborted before it notices that its pushee's transaction was aborted.
> For example, in the simplest case, imagine two requests deadlocked on
> each other. If their transactions are both aborted and each push notices
> the pushee is aborted first, they will both return here triumphantly and
> wait for the other to exit its lock wait-queues, leading to deadlock.
> Even if they eventually pushed each other again, there would be no
> guarantee that the same thing wouldn't happen.
>
> However, such a situation is not possible in practice because such a
> dependency cycle is never constructed by the lockTable. The lockTable
> assigns each request a monotonically increasing sequence number upon its
> initial entrance to the lockTable. This sequence number is used to
> straighten out dependency chains of requests such that a request only
> waits on conflicting requests with lower sequence numbers than its own
> sequence number. This behavior guarantees that request-only dependency
> cycles are never constructed by the lockTable. Put differently, all
> dependency cycles must include at least one dependency on a lock and,
> therefore, one call to pushLockTxn. Unlike pushRequestTxn, pushLockTxn
> actively removes the conflicting lock and removes the dependency when it
> determines that its pushee transaction is aborted. This means that the
> call to pushLockTxn will continue to make forward progress in the case of
> a simultaneous abort of all transactions behind the members of the cycle,
> preventing such a hypothesized deadlock from ever materializing.

The PR also includes a good amount of other cleanup that I was intending to land with the fix to this deadlock. For instance, it splits off a `LockAcquisition` type from the `LockUpdate` type. It also cleans up the internals of `lock_table.go`.

47727: server: various server construction cleanup r=nvanbenschoten a=nvanbenschoten

This is all cleanup I stumbled upon while catching up on the changes made in the following PRs:
- #46843
- #46975
- #47509
- #47517
- #47570

It's all pretty minor.

Co-authored-by: Nathan VanBenschoten <[email protected]>
@tbg tbg added the A-multitenancy Related to multi-tenancy label Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-multitenancy Related to multi-tenancy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants