-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
24845: rpc: ConnHealth now kicks off a connection attempt r=tschottdorf a=bdarnell When #22658 changed ConnHealth to be pessimistic instead of optimistic, it meant that distsql could theoretically get stuck in a state without connections to the necessary nodes (distsql would never initiate connections on its own; it only attempts to use connections for which ConnHealth returns true so it was effectively relying on raft/kv to initiate these connections). Now ConnHealth will attempt to start a connection process if none is in flight to ensure that we will eventually discover the health of any address we are concerned about. Updated the ConnHealth docstring to reflect this change and the change to pessimistic behavior. Fixes #23829 Release note: None 24852: ui, sql: fix display of "database dropped" event. r=couchand a=vilterp The DROP_DATABASE event in `system.eventlog` was changed from having the key `DroppedTables` to having the key `DroppedTablesAndViews`. The corresponding UI code which displays the dropped tables was not changed, creating bug #18523. This commit fixes #18523 by renaming the key to `DroppedSchemaObjects`, both in the event and in the UI code. The term "Schema Objects" accounts for the existence of sequences in addition to views and tables. Q: is it worth adding a migration to change old events from `DroppedTablesAndViews` to `DroppedSchemaObjects`? I'm leaning toward no, since (a) it doesn't look like we added a migration when we renamed `DroppedTables` to `DroppedTablesAndViews`, and (b) without the migration, you'll still see the "drop database" event in the UI, just not the table names (but they'll be in `system.eventlog` under the old key). Release note (admin ui change): display the names of dropped schema objects on `DROP DATABASE ... CASCADE` Co-authored-by: Ben Darnell <[email protected]> Co-authored-by: Pete Vilter <[email protected]>
- Loading branch information
Showing
8 changed files
with
101 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { assert } from "chai"; | ||
import { EventInfo, getDroppedObjectsText } from "src/util/events"; | ||
|
||
describe("getDroppedObjectsText", function() { | ||
|
||
// The key indicating which objects were dropped in a DROP_DATABASE event has been | ||
// renamed multiple times, creating bugs (e.g. #18523). This test won't fail if the | ||
// key is renamed again on the Go side, but it at least tests that we can handle all | ||
// existing versions. | ||
it("returns a sentence for all versions of the dropped objects key", function() { | ||
const commonProperties: EventInfo = { | ||
User: "root", | ||
DatabaseName: "foo", | ||
}; | ||
const versions: EventInfo[] = [ | ||
{ | ||
...commonProperties, | ||
DroppedTables: ["foo", "bar"], | ||
}, | ||
{ | ||
...commonProperties, | ||
DroppedTablesAndViews: ["foo", "bar"], | ||
}, | ||
{ | ||
...commonProperties, | ||
DroppedSchemaObjects: ["foo", "bar"], | ||
}, | ||
]; | ||
|
||
const expected = "2 schema objects were dropped: foo, bar"; | ||
|
||
versions.forEach((eventInfoVersion) => { | ||
assert.equal(expected, getDroppedObjectsText(eventInfoVersion)); | ||
}); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters