programing

Innodbon MariaDB가 자동으로 쓰기 실패 중입니다.

muds 2023. 9. 8. 21:47
반응형

Innodbon MariaDB가 자동으로 쓰기 실패 중입니다.

테이블 행에 대한 업데이트를 오류 없이 작성하지 못하는 것으로 보이는 시스템이 있습니다.
쿼리 세부 정보는 성공한 것으로 보고되는 단순 업데이트이지만 데이터는 데이터베이스 테이블 행에 기록되지 않습니다.

나는 모든 sql 읽기/쓰기를 처리하는 데 사용하는 개체가 있습니다.성공적인 트랜잭션 후 개체 덤프가 포함됩니다.

[pdo:Gibbon\core\security:private] => Gibbon\core\sqlConnection Object
    (
        [pdo:protected] => PDO Object
            (
            )

        [success:Gibbon\core\sqlConnection:private] => 1
        [querySuccess:Gibbon\core\sqlConnection:private] => 1
        [result:Gibbon\core\sqlConnection:private] => PDOStatement Object
            (
                [queryString] => UPDATE `gibbonPerson`
        SET  `passwordStrong` = :passwordStrong, `passwordStrongSalt` = :passwordStrongSalt, `password` = :password WHERE `gibbonPersonID` = :gibbonPersonID
            )

        [data:Gibbon\core\sqlConnection:private] => Array
            (
                [:passwordStrong] => $2y$12$1EZ30jh/CJ/gNwo/alLLlOW/HbcfxCv7tveZgU5jeJ//y.ayiqto2
                [:passwordStrongSalt] => 
                [:password] => 
                [:gibbonPersonID] => 0000000001
            )

        [query:Gibbon\core\sqlConnection:private] => UPDATE `gibbonPerson`
        SET  `passwordStrong` = :passwordStrong, `passwordStrongSalt` = :passwordStrongSalt, `password` = :password WHERE `gibbonPersonID` = :gibbonPersonID
        [error:Gibbon\core\sqlConnection:private] => 
        [table:Gibbon\core\sqlConnection:private] => gibbonPerson
        [identifier:Gibbon\core\sqlConnection:private] => gibbonPersonID
        [where:Gibbon\core\sqlConnection:private] => 
        [version:Gibbon\core\sqlConnection:private] => 5.5.50-MariaDB
        [lastQuery] => UPDATE `gibbonPerson`
        SET  `passwordStrong` = :passwordStrong, `passwordStrongSalt` = :passwordStrongSalt, `password` = :password WHERE `gibbonPersonID` = :gibbonPersonID
        [insert] => 
    )

이 실행 직후 스크립트 실행(die();)을 중지하면 데이터가 올바르게 저장되므로 메모리에서 디스크로 이동하는 데이터 플러시 작업이 실패했다고 생각합니다.서버에 대한 설정은 다음과 같습니다.

character-set-server = utf8
collation-server = utf8_unicode_ci
default-storage-engine = InnoDB    
innodb_change_buffering = all    
innodb_buffer_pool_size = 800M    
innodb_log_file_size = 256M    
innodb_log_buffer_size = 4M    
innodb_flush_log_at_trx_commit = 2    
innodb_thread_concurrency = 8    
innodb_flush_method = O_DIRECT    
innodb_file_per_table = ON    
max_heap_table_size = 64M    
query_cache_size = 32M    
table_cache = 256    
read_buffer_size = 8M    
read_rnd_buffer_size = 8M    
sort_buffer_size = 8M    
tmp_table_size = 64M

연결 설정은 다음과 같습니다.

private function setSQLMode()
{
    $config = new config();
    $setting = $config->get('setting');
    if (isset($setting['System']['installtype']) && $setting['System']['installtype'] == 'Production')
        $this->getConnection()->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);       // Production
    else
        $this->getConnection()->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);   //Testing and Development
    $this->getConnection()->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
    $this->getConnection()->setAttribute(PDO::ATTR_AUTOCOMMIT, true); 
    $this->version = $this->getVersion();
    if ($this->version > '5.7')  //Default for 5.7.x is STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_AUTO_CREATE_USER
        $result = $this->getConnection()->prepare("SET SESSION `sql_mode` = ''");
    elseif ($this->version > '5.6')  // Default for 5.6.x is NO_ENGINE_SUBSTITUTION
        $result = $this->getConnection()->prepare("SET SESSION `sql_mode` = ''");
    else // Default for < 5.6 is ''
        $result = $this->getConnection()->prepare("SET SESSION `sql_mode` = ''");
    $result->execute(array());
}

여기서 무슨 일이 일어나고 있는지 아는 사람?무음으로 설정을 변경하고 다른 게시물을 읽고 자료를 작성하지 못하니 막막합니다.어떤 도움이라도 주시면 감사하겠습니다!크레이그

RAM은 가상 시스템에서 1G이므로 크기가 작습니다.

테이블 만들기 표시

gibbonPerson    CREATE TABLE `gibbonPerson` (
  `gibbonPersonID` int(10) unsigned zerofill NOT NULL AUTO_INCREMENT,
  `title` varchar(5) CHARACTER SET utf8 NOT NULL,
  `surname` varchar(30) CHARACTER SET utf8 NOT NULL DEFAULT '',
  `firstName` varchar(30) CHARACTER SET utf8 NOT NULL DEFAULT '',
  `preferredName` varchar(30) CHARACTER SET utf8 NOT NULL DEFAULT '',
  `officialName` varchar(150) CHARACTER SET utf8 NOT NULL,
  `nameInCharacters` varchar(20) CHARACTER SET utf8 NOT NULL,
  `gender` enum('M','F','Other','Unspecified') CHARACTER SET utf8 NOT NULL DEFAULT 'Unspecified',
  `username` varchar(20) CHARACTER SET utf8 NOT NULL,
  `password` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '',
  `passwordStrong` varchar(255) CHARACTER SET utf8 NOT NULL,
  `passwordStrongSalt` varchar(255) CHARACTER SET utf8 NOT NULL,
  `passwordForceReset` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N' COMMENT 'Force user to reset password on next login.',
  `status` enum('Full','Expected','Left','Pending Approval') CHARACTER SET utf8 NOT NULL DEFAULT 'Full',
  `canLogin` enum('Y','N') CHARACTER SET utf8 NOT NULL DEFAULT 'Y',
  `gibbonRoleIDPrimary` int(3) unsigned zerofill NOT NULL,
  `gibbonRoleIDAll` varchar(255) CHARACTER SET utf8 NOT NULL,
  `dob` date DEFAULT NULL,
  `email` varchar(50) CHARACTER SET utf8 DEFAULT NULL,
  `emailAlternate` varchar(50) CHARACTER SET utf8 NOT NULL,
  `image_240` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `lastIPAddress` varchar(15) CHARACTER SET utf8 NOT NULL DEFAULT '',
  `lastTimestamp` timestamp NULL DEFAULT NULL,
  `lastFailIPAddress` varchar(15) CHARACTER SET utf8 DEFAULT NULL,
  `lastFailTimestamp` timestamp NULL DEFAULT NULL,
  `failCount` int(1) DEFAULT '0',
  `address1` mediumtext CHARACTER SET utf8 NOT NULL,
  `address1District` varchar(255) CHARACTER SET utf8 NOT NULL,
  `address1Country` varchar(255) CHARACTER SET utf8 NOT NULL,
  `address2` mediumtext CHARACTER SET utf8 NOT NULL,
  `address2District` varchar(255) CHARACTER SET utf8 NOT NULL,
  `address2Country` varchar(255) CHARACTER SET utf8 NOT NULL,
  `phone1Type` enum('','Mobile','Home','Work','Fax','Pager','Other') CHARACTER SET utf8 NOT NULL DEFAULT '',
  `phone1CountryCode` varchar(7) CHARACTER SET utf8 NOT NULL,
  `phone1` varchar(20) CHARACTER SET utf8 NOT NULL,
  `phone3Type` enum('','Mobile','Home','Work','Fax','Pager','Other') CHARACTER SET utf8 NOT NULL DEFAULT '',
  `phone3CountryCode` varchar(7) CHARACTER SET utf8 NOT NULL,
  `phone3` varchar(20) CHARACTER SET utf8 NOT NULL,
  `phone2Type` enum('','Mobile','Home','Work','Fax','Pager','Other') CHARACTER SET utf8 NOT NULL DEFAULT '',
  `phone2CountryCode` varchar(7) CHARACTER SET utf8 NOT NULL,
  `phone2` varchar(20) CHARACTER SET utf8 NOT NULL,
  `phone4Type` enum('','Mobile','Home','Work','Fax','Pager','Other') CHARACTER SET utf8 NOT NULL DEFAULT '',
  `phone4CountryCode` varchar(7) CHARACTER SET utf8 NOT NULL,
  `phone4` varchar(20) CHARACTER SET utf8 NOT NULL,
  `website` varchar(255) CHARACTER SET utf8 NOT NULL,
  `languageFirst` varchar(30) CHARACTER SET utf8 NOT NULL,
  `languageSecond` varchar(30) CHARACTER SET utf8 NOT NULL,
  `languageThird` varchar(30) CHARACTER SET utf8 NOT NULL,
  `countryOfBirth` varchar(30) CHARACTER SET utf8 NOT NULL,
  `ethnicity` varchar(255) CHARACTER SET utf8 NOT NULL,
  `citizenship1` varchar(255) CHARACTER SET utf8 NOT NULL,
  `citizenship1Passport` varchar(30) CHARACTER SET utf8 NOT NULL,
  `citizenship1PassportScan` varchar(255) CHARACTER SET utf8 NOT NULL,
  `citizenship2` varchar(255) CHARACTER SET utf8 NOT NULL,
  `citizenship2Passport` varchar(30) CHARACTER SET utf8 NOT NULL,
  `religion` varchar(30) CHARACTER SET utf8 NOT NULL,
  `nationalIDCardNumber` varchar(30) CHARACTER SET utf8 NOT NULL,
  `nationalIDCardScan` varchar(255) CHARACTER SET utf8 NOT NULL,
  `residencyStatus` varchar(255) CHARACTER SET utf8 NOT NULL,
  `visaExpiryDate` date DEFAULT NULL,
  `profession` varchar(30) CHARACTER SET utf8 NOT NULL,
  `employer` varchar(30) CHARACTER SET utf8 NOT NULL,
  `jobTitle` varchar(30) CHARACTER SET utf8 NOT NULL,
  `emergency1Name` varchar(30) CHARACTER SET utf8 NOT NULL,
  `emergency1Number1` varchar(30) CHARACTER SET utf8 NOT NULL,
  `emergency1Number2` varchar(30) CHARACTER SET utf8 NOT NULL,
  `emergency1Relationship` varchar(30) CHARACTER SET utf8 NOT NULL,
  `emergency2Name` varchar(30) CHARACTER SET utf8 NOT NULL,
  `emergency2Number1` varchar(30) CHARACTER SET utf8 NOT NULL,
  `emergency2Number2` varchar(30) CHARACTER SET utf8 NOT NULL,
  `emergency2Relationship` varchar(30) CHARACTER SET utf8 NOT NULL,
  `gibbonHouseID` int(3) unsigned zerofill DEFAULT NULL,
  `studentID` varchar(10) CHARACTER SET utf8 NOT NULL,
  `dateStart` date DEFAULT NULL,
  `dateEnd` date DEFAULT NULL,
  `gibbonSchoolYearIDClassOf` int(3) unsigned zerofill DEFAULT NULL,
  `lastSchool` varchar(100) CHARACTER SET utf8 NOT NULL,
  `nextSchool` varchar(100) CHARACTER SET utf8 NOT NULL,
  `departureReason` varchar(50) CHARACTER SET utf8 NOT NULL,
  `transport` varchar(255) CHARACTER SET utf8 NOT NULL,
  `transportNotes` text CHARACTER SET utf8 NOT NULL,
  `calendarFeedPersonal` text CHARACTER SET utf8 NOT NULL,
  `viewCalendarSchool` enum('Y','N') CHARACTER SET utf8 NOT NULL DEFAULT 'Y',
  `viewCalendarPersonal` enum('Y','N') CHARACTER SET utf8 NOT NULL DEFAULT 'Y',
  `viewCalendarSpaceBooking` enum('Y','N') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  `gibbonApplicationFormID` int(12) unsigned zerofill DEFAULT NULL,
  `lockerNumber` varchar(20) CHARACTER SET utf8 NOT NULL,
  `vehicleRegistration` varchar(20) CHARACTER SET utf8 NOT NULL,
  `personalBackground` varchar(255) CHARACTER SET utf8 NOT NULL,
  `messengerLastBubble` date DEFAULT NULL,
  `privacy` text CHARACTER SET utf8,
  `dayType` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT 'Student day type, as specified in the application form.',
  `gibbonThemeIDPersonal` int(4) unsigned zerofill DEFAULT NULL,
  `gibboni18nIDPersonal` int(4) unsigned zerofill DEFAULT NULL,
  `studentAgreements` text CHARACTER SET utf8,
  `googleAPIRefreshToken` varchar(255) CHARACTER SET utf8 NOT NULL,
  `receiveNotificationEmails` enum('Y','N') CHARACTER SET utf8 NOT NULL DEFAULT 'Y',
  `fields` text CHARACTER SET utf8 NOT NULL COMMENT 'Serialised array of custom field values',
  PRIMARY KEY (`gibbonPersonID`),
  UNIQUE KEY `username` (`username`),
  KEY `username_2` (`username`,`email`)
) ENGINE=InnoDB AUTO_INCREMENT=1817 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

작은 1GB "기계"의 경우 다음과 같은 "높음" 설정으로 인해 미친 듯이 스왑할 수 있습니다.

innodb_buffer_pool_size = 800M      --> 60M
max_heap_table_size = 64M           --> 5M
query_cache_size = 32M              --> 5M
table_cache = 256                   --> 100
read_buffer_size = 8M               --> 4M
read_rnd_buffer_size = 8M           --> 4M
sort_buffer_size = 8M               --> 4M
tmp_table_size = 64M                --> 5M

열에 배열을 표시하지 말고 시민권, 주소, 전화 등을 위한 표를 추가로 만듭니다.

어떻게 있다.:password대체?그것이 적절하게 탈출하여 인용되었습니까?실패한 경우에 어떤 특수 캐릭터가 있었습니까?

언급URL : https://stackoverflow.com/questions/39401840/innodb-on-mariadb-is-write-failing-silently

반응형