Skip to content

Commit

Permalink
[pg15] Bulk port from master to pg15-cherrypicks - 34
Browse files Browse the repository at this point in the history
Summary:
 411a32e [DB-11813] Rename ysql_conn_mgr_idle_or_pending_clients metric name
 c2e13ef [#15682] YSQL: Fix stack_is_too_deep function in ASAN
 ef31455 [PLAT-14188] Fixing upgrade disk availability check
 db6b1b7 [#23004] YCQL: Fix tserver crash due to NULL pointer dereference
 0ada80a [PLAT-14433] Use correct kubeconfig for edit provider validation
 eccbc10 [PLAT-14414] Enable Kubernetes provider validation by default
 199f679 [PLAT-14324]: Move all node agent based flags from BETA to INTERNAL in Provider Conf keys file
 86a865d [PLAT-14443] YBA Installer wait for ready time configurable.
 ac184a8 [#22882] YSQL: Fix deadlock in DDL atomicity
 a4218fb [Docs] Sort feature to tables (Where fulfills the criteria) (#22836)
 2f267ca [#22996] xCluster: Add SOURCE_UNREACHABLE and SYSTEM_ERROR enums

Skipped due to conflict:
dee7691 [#21534] docdb: Set owner correctly for cloned databases
34632ba [PLAT-14495] Set up the node_exporter for ynp
7c99ff9 [#22876][#22773] CDCSDK: Add new yb-admin command to remove user table from CDCSDK stream
4e9a81c [#22876][#22835][#22773] CDCSDK: Remove non-eligible tables for CDC from existing CDCSDK stream
f2e574e [#23013] xClusterDDLRepl: Allow table_ids for GetXClusterStreams

Test Plan: Jenkins: rebase: pg15-cherrypicks

Reviewers: tfoucher, sanketh, jenkins-bot

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D36184
  • Loading branch information
hari90 authored and jaki committed Jun 27, 2024
1 parent 51efa9f commit a57b2c7
Show file tree
Hide file tree
Showing 40 changed files with 418 additions and 88 deletions.
62 changes: 51 additions & 11 deletions docs/assets/scss/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ main {
margin: 20px 0;
max-width: 828px;

> table{
> table {
margin: 0 !important;
border: none;
box-shadow: none;
@media(max-width:900px){
min-width:650px;
}
tbody{

@media (max-width:900px) {
min-width:650px;
}

tbody {
border-bottom:0;

tr:last-child{
//background: red;
td{
tr:last-child {
td {
border-bottom:0px;
}
}
Expand Down Expand Up @@ -70,7 +71,8 @@ main {
}

&.sno-last {
tr th:last-child, tr td:last-child {
tr th:last-child,
tr td:last-child {
width: 1%;
}
}
Expand All @@ -97,6 +99,46 @@ main {
}
}

&.sortable tr {
th {
position: relative;

&.empty-th .sort-btn {
display: none;
}

.sort-btn {
font-size: 0;
width: 5px;
height: 20px;
display: inline-block;
vertical-align: middle;
text-align: center;
cursor: pointer;
position: absolute;

&::after {
color: #97a5b0;
display: inline-block;
font-size: 14px;
width: 0;
height: 0;
background-size: contain;
border-radius: 4px;
margin-top: 0;
margin-left: 5px;
transition: all 300ms linear;
content: "\f0d7";
font-family: "Font Awesome 6 Pro";
}

&.sorted::after {
content: "\f0d8";
}
}
}
}

tr {
&:not(:last-child) {
border-color: #e9eef2;
Expand Down Expand Up @@ -131,8 +173,6 @@ main {
}
}



@media (min-width: 1024px) {
main {
.td-content {
Expand Down
84 changes: 84 additions & 0 deletions docs/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,90 @@ $(document).ready(() => {
}
});

/**
Sort option in table.
*/
(() => {
const tables = document.querySelectorAll('.td-content .table-responsive table.sortable');
tables.forEach(table => {
const headersEmpty = table.querySelectorAll('th:empty');
headersEmpty.forEach((innerDiv) => {
innerDiv.classList.add('empty-th');
});

const headers = table.querySelectorAll('th');
const tbody = table.tBodies[0];
const totalRows = tbody.querySelectorAll('tr');

let sortOrder = 1;
if (totalRows.length > 1) {
headers.forEach((header, index) => {
const sortSpan = document.createElement('span');
const tdsEmpty = table.querySelectorAll(`td:nth-child(${index + 1})`);

let emptyCellsCount = 0;
tdsEmpty.forEach((emptyCell) => {
if (emptyCell.textContent.trim() !== '') {
emptyCellsCount += 1;
}
});

if (emptyCellsCount === 0) {
table.querySelector(`thead th:nth-child(${index + 1})`).classList.add('empty-th');
}

sortSpan.textContent = 'Sort';
sortSpan.classList.add('sort-btn');
header.appendChild(sortSpan);
sortSpan.addEventListener('click', (ev) => {
ev.target.classList.toggle('sorted');
sortTableByColumn(table, index, sortOrder);
sortOrder *= -1;
});
});
}
});

function sortTableByColumn(table, columnIndex, sortOrder) {
const tbody = table.tBodies[0];
const rows = Array.from(tbody.querySelectorAll('tr'));
const sortedRows = rows.sort((a, b) => {
let aText = '';
let bText = '';
let returnVal = '';

if (a.cells[columnIndex] && a.cells[columnIndex].textContent) {
aText = a.cells[columnIndex].textContent.replace(/[,\-(]/g, '').trim();
}

if (b.cells[columnIndex] && b.cells[columnIndex].textContent) {
bText = b.cells[columnIndex].textContent.replace(/[,\-(]/g, '').trim();
}

if (aText === '' && bText === '') {
returnVal = 0;
} else if (aText === '') {
returnVal = 1;
} else if (bText === '') {
returnVal = -1;
} else {
returnVal = sortOrder * aText.localeCompare(bText, 'en', {
numeric: true,
sensitivity: 'base',
});
}

return returnVal;
});

while (tbody.firstChild) {
tbody.removeChild(tbody.firstChild);
}

tbody.append(...sortedRows);
}
})();

if ($('.component-box').length > 0) {
$('.component-box li p a').each(function () {
$(this).parents('li').addClass('linked-box');
Expand Down
11 changes: 11 additions & 0 deletions java/yb-cql/src/test/java/org/yb/cql/TestBindVariable.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@ public void testSelectBind() throws Exception {
assertNull(row);
}

{
// Ensure that this doesn't crash the tserver
String selectStmt = "SELECT ? FROM test_bind;";
try {
ResultSet rs = session.execute(selectStmt, new Integer(1));
fail("Statement \"" + selectStmt + "\" did not fail undefined bind variable name");
} catch (com.datastax.driver.core.exceptions.InvalidQueryException e) {
LOG.info("Expected exception ", e);
}
}

LOG.info("End test");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class TestStatsAndMetrics extends BaseYsqlConnMgr {
"user_name",
"active_logical_connections",
"queued_logical_connections",
"idle_or_pending_logical_connections",
"waiting_logical_connections",
"active_physical_connections",
"idle_physical_connections",
"avg_wait_time_ns",
Expand Down Expand Up @@ -117,7 +117,7 @@ private void testNumLogicalConnections(String db_name,
int num_logical_conn =
pool.get("active_logical_connections").getAsInt() +
pool.get("queued_logical_connections").getAsInt() +
pool.get("idle_or_pending_logical_connections").getAsInt();
pool.get("waiting_logical_connections").getAsInt();
assertEquals("Did not get the expected number of logical connections for pool with user "
+ user_name + " and database " + db_name, exp_val, num_logical_conn);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ public class ProviderConfKeys extends RuntimeConfigKeysModule {
"Min Python Version (inclusive)",
"",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.BETA));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<String> maxPyVer =
new ConfKeyInfo<>(
"yb.node_agent.preflight_checks.max_python_version",
ScopeType.PROVIDER,
"Max Python Version (exclusive)",
"",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.BETA));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<Integer> defaultAwsVolumeCount =
new ConfKeyInfo<>(
"yb.aws.default_volume_count",
Expand Down Expand Up @@ -208,87 +208,87 @@ public class ProviderConfKeys extends RuntimeConfigKeysModule {
"User",
"",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.BETA));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<String> userGroup =
new ConfKeyInfo<>(
"yb.node_agent.preflight_checks.user_group",
ScopeType.PROVIDER,
"User Group",
"",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.BETA));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<Integer> minPrometheusSpaceMb =
new ConfKeyInfo<>(
"yb.node_agent.preflight_checks.min_prometheus_space_mb",
ScopeType.PROVIDER,
"Min Prometheus Space MB",
"",
ConfDataType.IntegerType,
ImmutableList.of(ConfKeyTags.BETA));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<Integer> minTempDirSpaceMb =
new ConfKeyInfo<>(
"yb.node_agent.preflight_checks.min_tmp_dir_space_mb",
ScopeType.PROVIDER,
"Min Temp Dir Space MB",
"",
ConfDataType.IntegerType,
ImmutableList.of(ConfKeyTags.BETA));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<Integer> minHomeDirSpaceMb =
new ConfKeyInfo<>(
"yb.node_agent.preflight_checks.min_home_dir_space_mb",
ScopeType.PROVIDER,
"Min Home Space MB",
"",
ConfDataType.IntegerType,
ImmutableList.of(ConfKeyTags.BETA));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<Integer> minMountPointDirSpaceMb =
new ConfKeyInfo<>(
"yb.node_agent.preflight_checks.min_mount_point_dir_space_mb",
ScopeType.PROVIDER,
"Min Mount Point Dir Space MB",
"",
ConfDataType.IntegerType,
ImmutableList.of(ConfKeyTags.BETA));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<String> ulimitCore =
new ConfKeyInfo<>(
"yb.node_agent.preflight_checks.ulimit_core",
ScopeType.PROVIDER,
"ulimit core ",
"",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.BETA));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<String> ulimitOpenFiles =
new ConfKeyInfo<>(
"yb.node_agent.preflight_checks.ulimit_open_files",
ScopeType.PROVIDER,
"ulimit open files",
"",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.BETA));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<String> ulimitUserProcesses =
new ConfKeyInfo<>(
"yb.node_agent.preflight_checks.ulimit_user_processes",
ScopeType.PROVIDER,
"ulimit user processes",
"",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.BETA));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<Integer> swappiness =
new ConfKeyInfo<>(
"yb.node_agent.preflight_checks.swappiness",
ScopeType.PROVIDER,
"swappiness",
"",
ConfDataType.IntegerType,
ImmutableList.of(ConfKeyTags.BETA));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<Integer> sshTimeout =
new ConfKeyInfo<>(
"yb.node_agent.preflight_checks.ssh_timeout",
ScopeType.PROVIDER,
"SSH connection timeout",
"",
ConfDataType.IntegerType,
ImmutableList.of(ConfKeyTags.BETA));
ImmutableList.of(ConfKeyTags.INTERNAL));

public static final ConfKeyInfo<Boolean> enableNodeAgentClient =
new ConfKeyInfo<>(
Expand All @@ -306,7 +306,7 @@ public class ProviderConfKeys extends RuntimeConfigKeysModule {
"VM max map count",
"Max count of memory-mapped regions allowed in the system.",
ConfDataType.IntegerType,
ImmutableList.of(ConfKeyTags.BETA));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<Boolean> enableAnsibleOffloading =
new ConfKeyInfo<>(
"yb.node_agent.ansible_offloading.enabled",
Expand Down
Loading

0 comments on commit a57b2c7

Please sign in to comment.