replication – Choosing name for MongoDB replica set

Are there any guidelines for choosing names for MongoDB replica sets? The documentation seems to mostly contain examples like rs1, rs-test, … Is replica set name fully redundant, or could it reflect some entity?

I am setting up a new MongoDB service in my organization. Eventually we plan to serve multiple applications, so I think the replica set names that appear in the customer’s connection string should be generic, but meaningful. Would love to hear the words of wisdom from the experienced DBAs.

sql server – SQL Cluster (Always On) – Database table replication

I have the following scenario at this moment.
Two old sql servers – they have setup some kind of publisher subscriber replication from one database to another but only some of the tables at a 12 hour time span.

I have built and Always On cluster , where I have created one listener but I have three availability groups, one for each database.
I would like to know how could I implement that sort of replication from one database to another and keep the SQL always On .

Techincal Details – I have WS2K19 Standrad edition with SQL 2017 Standrad edition latest CU , and only two nodes in the SQL cluster and a witness disk to provide qvorum.
SQLNODE1
SQLNODE2

Could maybe someone propose or share a solution ? I want to keep the SQL always on for HA/DR as the two vm’s are in different locations .

replication user active directory between sub domain windows 2008 to windows 2019

i have a questions,
i have one forest with name xyz.co.id
and in this forest i have created sub domain with name fa.xyz.co.id (windows server 2008 R2), dc.xyz.co.id (windows server 2019) user object active directory located in fa.xyz.co.id, my question is how i can replicate my user active directory in fa.xyz.co.id to dc.xyz.co.id ? anybody can help me?

i try to check in active directory sites and services in fa.xyz.co.id but no list server dc.xyz.co.id

Understanding MySQL Innodb replication issue

I am trying to flip MySQL primary/ RW database from one host to other host. There are times where replication on the workers is broken post flip. Trying to understand the internal details and best possible implementation to have a smooth flip without breaking replication

Architecture

1 DB host and 2 active replicas (for failover). 20 worker nodes which server RO traffic.

MySql – 5.6 and logs setting in my.cnf file are default setting (never purge)

Steps for flip

For readability, host A – current primary; host B – current secondary being promoted as new primary

  1. Replication is current across all worker nodes.
  2. Make host A RO, verify GTID of host A is on host B
  3. If GTID is not replicated, do a manual dump of host A and restore on host B
  4. Promote host B as primary
  5. Update cname of primary DB
  6. Update replication across all workers to new primary
  7. If replication is broken(below error), restore dump across broken workers (fall back scenario)

Step 5 detail mysql commands:

stop slave
change master to master_host="" master_port="" master_auto_position="" ...
start slave

Error for broken replication:

error 1236, Got fatal error 1236 from master when reading data from binary log: 
'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, 
but the master has purged binary logs containing GTIDs that the slave requires. 
Replicate the missing transactions from elsewhere, or provision a new slave from backup. 
Consider increasing the master's binary log expiration period. The GTID sets and the missing 
purged transactions are too long to print in this message. For more information, 
please see the master's error log or the manual for GTID_SUBTRACT.'

Goals

Prefer to avoid step 6, as we each restore takes ~10 min and we have 20 hosts. Sequential restore takes around 200 minutes (200 min of no strong consistency => poor design)

Trying to restore asynchronously across all hosts – https://stackoverflow.com/questions/66763150/cat-unix-command-multithread-safe-looking-for-parallel-mysql-restore-on-severa

Questions

MySQL Read-only Replication – Database Administrators Stack Exchange

It depends on the version.

Look for “multi-source” replication. This is where multiple Primaries can replicate to a single Replica. But this does not say how you would restore a single Primary that dies.

Consider using a single Primary for everything, then have one (or more) Replicas.

Or you could have multiple Primary-Replica pairs sitting in VMs or Dockers. The pair would, of course, have its parts on separate machines, preferably geographically separated (think storms, earthquakes, etc).

C# to C++: Basic Console Replication

I’m working on converting my basic cryptocurrency miner from C# to C++ for performance reasons (I’ve been told that C++ is faster in many aspects). However, that aside, the focus of this post is to get some feedback for a very basic port of ReadLine, Write and WriteLine as I understand them, from C# to C++. This way, I don’t get too far along before learning lessons the hard way.

Console.h

From my understanding, this file is mostly meant for definitions, such as an interface in C# in that implementation should not occur here, though it’s not disallowed (unlike C# where it is disallowed):

#pragma once
#include <string>
using namespace std;
class Console
{
public:
    static string ReadLine();
    static void Write(string input);
    static void WriteLine(string input);
};

Console.cpp

The concept of separating definition from implementation is a bit new to me (outside of interfaces and members marked as abstract in C#). The part that threw me off here is that the static keyword is dropped when writing out the function:

#include "Console.h"
#include <iostream>
#include <string>
using namespace std;
string Console::ReadLine() {
    string result;
    cin >> result;
    return result;
}
void Console::Write(string input) { cout << input; }
void Console::WriteLine(string input) { cout << input + "n"; }

CryptoSandbox.cpp

This is my entry point, I didn’t really change much. I simply replaced the original cout << "Hello World" with Console::WriteLine(...), which required inclusion of Console.h to compile, so lesson learned fast there:

#include "Console.h"
#include <string>
using namespace std;
int main() {
    Console::Write("Starting the crypto sandbox. Please tell us your name: ");
    string userName = Console::ReadLine();
    Console::WriteLine("Welcome to the crypto sandbox, " + userName + "!");
}

The goal of this post is to learn what I can simplify, and anything that can be done better. A few questions hitting me hard are:

  • How does organization not become quickly overwhelming based on how VS Community creates the initial project structure?
  • Why is static not accepted in the cpp file when the declaration states static void in the h file?

Outside of those two questions (entirely optional, by the way), my primary focus is certainly feedback on my port.

replication – High Memory Usage on Replica – Mysql 8

Hope you’re doing well.

We’ve recently moved to Mysql 8 (from Mysql 5.7).

We’re using AWS RDS Service with MySql. The AWS Team is also looking for a solution btw.

Since a few days, we’re facing several problem with replication. We never met these problems before with the 5.7 version.

First, we had a very import lag among our Master and our two replicas.

This was solved with specifics params on the Parameters group of the replica like :

  • slave_parallel_type in LOGICAL_CLOCK mode
  • binlog_group_commit_sync_delay with a 10ms delay
  • sync_binlog at 0

It seems that the latency is now gone, and it’s a good news (i’ll wait several days to be sure).

Nevertheless, we’re still facing a massive problem with the RAM used on the Replica.

We can’t find the problem, perhaps the buffer, but it must be locked with a threshold.

It’s a cycle movement like this :

High Memory usage on replica versus Production

In Green, the production.

In Orange the small replica.

In Blue the most powerfull replica (As you can see, we tried to upgrade the instance, but it’s not a RAM limitation problem).

The problem is the same for both. The memory usage is increasing till the replica has to down.

By the way, the swap is never used.

If you have any clue with this, it will help me a lot!

Thanks for reading!

Have a nice day 🙂

Replication of core column block produces different markup

I’ve scaffolded a custom block via the official create-block package, I then went and pulled the code from the core block column from Github. And it seems to be working with some minor issues. For some reason my custom block gets a slightly different element structure where the block parent element gets nested within itself:

enter image description here

Whereas the core column block does not:
enter image description here

Any idea why this is happening? Relevant code below.

index.js

/**
 * WordPress dependencies
 */
import { registerBlockType } from '@wordpress/blocks';
import { __, _x } from '@wordpress/i18n';
import { column as icon } from '@wordpress/icons';

/**
 * Internal dependencies
 */
// import deprecated from './deprecated';
import edit from './edit';
import metadata from '../block.json';
import save from './save';

const { name } = metadata;

export { metadata, name };

export const settings = {
  title: _x( '12 Column', 'block title' ),
  icon,
  description: __( 'A single column within a columns block.' ),
  edit,
  save,
  // deprecated,
};

registerBlockType( 'wav/twelve-column', settings );

edit.js

/**
 * External dependencies
 */
import classnames from 'classnames';

/**
 * WordPress dependencies
 */
import {
  InnerBlocks,
  BlockControls,
  BlockVerticalAlignmentToolbar,
  InspectorControls,
  useBlockProps,
  __experimentalUseInnerBlocksProps as useInnerBlocksProps,
  store as blockEditorStore,
} from '@wordpress/block-editor';
import {
  PanelBody,
  __experimentalUnitControl as UnitControl,
} from '@wordpress/components';
import { useSelect, useDispatch } from '@wordpress/data';
import { __ } from '@wordpress/i18n';

/**
 * Internal dependencies
 */
import { CSS_UNITS } from './utils';

function ColumnEdit( {
  attributes: { verticalAlignment, width, templateLock = false },
  setAttributes,
  clientId,
} ) {
  const classes = classnames( 'block-core-columns', {
    ( `is-vertically-aligned-${ verticalAlignment }` ): verticalAlignment,
  } );

  const { hasChildBlocks, rootClientId } = useSelect(
    ( select ) => {
      const { getBlockOrder, getBlockRootClientId } = select(
        blockEditorStore
      );

      return {
        hasChildBlocks: getBlockOrder( clientId ).length > 0,
        rootClientId: getBlockRootClientId( clientId ),
      };
    },
    ( clientId )
  );

  const { updateBlockAttributes } = useDispatch( blockEditorStore );

  const updateAlignment = ( value ) => {
    // Update own alignment.
    setAttributes( { verticalAlignment: value } );
    // Reset parent Columns block.
    updateBlockAttributes( rootClientId, {
      verticalAlignment: null,
    } );
  };

  const widthWithUnit = Number.isFinite( width ) ? width + '%' : width;
  const blockProps = useBlockProps( {
    className: classes,
    style: widthWithUnit ? { flexBasis: widthWithUnit } : undefined,
  } );
  const innerBlocksProps = useInnerBlocksProps( blockProps, {
    templateLock,
    renderAppender: hasChildBlocks
      ? undefined
      : InnerBlocks.ButtonBlockAppender,
  } );

  return (
    <>
      <BlockControls>
        <BlockVerticalAlignmentToolbar
          onChange={ updateAlignment }
          value={ verticalAlignment }
        />
      </BlockControls>
      <InspectorControls>
        <PanelBody title={ __( 'Column settings' ) }>
          <UnitControl
            label={ __( 'Width' ) }
            labelPosition="edge"
            __unstableInputWidth="80px"
            value={ width || '' }
            onChange={ ( nextWidth ) => {
              nextWidth =
                0 > parseFloat( nextWidth ) ? '0' : nextWidth;
              setAttributes( { width: nextWidth } );
            } }
            units={ CSS_UNITS }
          />
        </PanelBody>
      </InspectorControls>
      <div { ...innerBlocksProps } />
    </>
  );
}

export default ColumnEdit;

save.js

/**
 * External dependencies
 */
import classnames from 'classnames';

/**
 * WordPress dependencies
 */
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor';

export default function save( { attributes } ) {
  const { verticalAlignment, width } = attributes;

  const wrapperClasses = classnames( {
    ( `is-vertically-aligned-${ verticalAlignment }` ): verticalAlignment,
  } );

  let style;

  if ( width ) {
    // Numbers are handled for backward compatibility as they can be still provided with templates.
    style = { flexBasis: Number.isFinite( width ) ? width + '%' : width };
  }

  return (
    <div
      { ...useBlockProps.save( {
        className: wrapperClasses,
        style,
      } ) }
    >
      <InnerBlocks.Content />
    </div>
  );
}

Object replication in Azure across subscriptions and accounts

I am trying to configure object replication for my blob storage container to another blob storage container in a different subscription that is in a different account. I can’t seem to figure out how to set that up so that I can see the destination subscription that is in a different account when configuring replication rules. Any ideas?