バグ #1
レポート集計プログラムの改修
ステータス: | 終了 | 開始日: | 2013/09/09 | |
---|---|---|---|---|
優先度: | 高め | 期日: | 2013/10/17 | |
担当者: | 山本 義治 | 進捗 %: | 100% | |
カテゴリ: | システム全般 | 予定工数: | 20.00時間 | |
対象バージョン: | - | 作業時間の記録: | 15.00時間 |
説明
毎分cronで実行している集計プログラムの改修。
web1、web2で同時刻に同一案件のログがある場合、
同時に集計プログラムが実行され、stat_logテーブルのinsertが重複する
不具合の解消。
履歴
#2 Admin Redmine が11年以上前に更新
- 期日 を 2013/08/22 から 2013/08/28 に変更
- 開始日 を 2013/08/20 から 2013/08/26 に変更
#4 山本 義治 が11年以上前に更新
複数UNIQUEキーの作成
+
INSERT ON DUPLICATE KEY UPDATE
※REPLACEだと重複行が削除されるので使わないように!
参考
http://d.hatena.ne.jp/IT7C/20100715/1279148768
http://d.hatena.ne.jp/IwamotoTakashi/20080329/p1¶
#5 山本 義治 が11年以上前に更新
- 期日 を 2013/08/28 から 2013/09/11 に変更
- 開始日 を 2013/08/26 から 2013/09/09 に変更
- 進捗 % を 0 から 50 に変更
・テスト環境web2へrsync→完了
・VPSにテスト用DB構築→完了
・重複insert再現テスト→再現されず
今後の方針
1) テスト環境のstat系phpを改修(複合キー+INSERT IGNORE)
2) 本番のclick.phpにてクリックログファイルを書き出す際に、テスト環境へも同時にログファイル作成するようにする
3) 本番、テストで同時にstat系phpにて集計される
4) 本番で重複が発生したタイミングで、テスト環境での状況を確認
5) テスト環境で重複が確認されなければ、ソースを本番適用する
#7 山本 義治 が11年以上前に更新
9/11(水)
[IGテスト環境:WEB1]
集計プログラムソース改修(INSERT文にIGNOREを付ける)
該当ソース
stat.php
stat_asp.php
stat_listing.php
stat_am.php
stat_am_asp.php
stat_am_listing.php
stat_rs.php
stat_rs_asp.php
stat_rs_listing.php
[VPS:DB]
stat系テーブル定義変更(WHERE句の条件のカラムを全て複合UNIQUEキーに変更)
該当テーブル
stat_log_YYYYMM
stat_log_asp_YYYYMM
stat_log_media_YYYYMM
stat_log_client_YYYYMM
stat_log_listing_YYYYMM
stat_log_banner_YYYYMM
stat_log_client_YYYYMM
stat_log_item_YYYYMM
stat_log_shop_YYYYMM
stat_log_free_YYYYMM
#8 山本 義治 が11年以上前に更新
複合ユニークキーの設定¶
alter table stat_log_201309 add unique(stat_date,m_id,c_id,item_id,p_id);
alter table stat_log_asp_201309 add unique(stat_date,asp_id,c_id,item_id,p_id);
alter table stat_log_media_201309 add unique(stat_date,m_id);
alter table stat_log_client_201309 add unique(stat_date,c_id);
alter table stat_log_listing_201309 add unique(stat_date,listing_id,c_id,keyword_id,p_id);
alter table stat_log_banner_201309 add unique(stat_date,c_id);
alter table stat_log_item_201309 add unique(stat_date,m_id,asp_id,c_id,item_id);
alter table stat_log_shop_201309 add unique(stat_date,m_id,c_id,shop_id);
#9 山本 義治 が11年以上前に更新
stat_logテーブル関連影響範囲¶
macbook:aff haltyt$ grep -R insert stat | grep stat_log
stat/stat.php: $sql = "insert into stat_log_".$log_month." set
stat/stat.php: $sql = "insert into stat_log_media_".$log_month." set
stat/stat.php: $sql = "insert into stat_log_client_".$log_month." set
stat/stat.php: $sql = "insert into stat_log_banner_".$log_month." set
stat/stat.php: $sql = "insert into stat_log_item_".$log_month." set
stat/stat.php: $sql = "insert into stat_log_shop_".$log_month." set
stat/stat_am.php: $sql = "insert into stat_log_".$log_month." set
stat/stat_am.php: $sql = "insert into stat_log_media_".$log_month." set
stat/stat_am.php: $sql = "insert into stat_log_client_".$log_month." set
stat/stat_am.php: $sql = "insert into stat_log_banner_".$log_month." set
stat/stat_am_asp.php: $sql = "insert into stat_log_asp_".$log_month." set
stat/stat_am_asp.php: $sql = "insert into stat_log_client_".$log_month." set
stat/stat_am_listing.php: $sql = "insert into stat_log_listing_".$log_month." set
stat/stat_am_listing.php: $sql = "insert into stat_log_client_".$log_month." set
stat/stat_asp.php: $sql = "insert into stat_log_asp_".$log_month." set
stat/stat_asp.php: $sql = "insert into stat_log_client_".$log_month." set
stat/stat_asp.php: $sql = "insert into stat_log_banner_".$log_month." set
stat/stat_asp.php: $sql = "insert into stat_log_item_".$log_month." set
stat/stat_asp_convert.php: $sql = "insert into stat_log_asp_".$log_month." set
stat/stat_asp_convert.php: $sql = "insert into stat_log_client_".$log_month." set
stat/stat_listing.php: $sql = "insert into stat_log_client_".$log_month." set
stat/stat_listing.php: $sql = "insert into stat_log_listing_".$log_month." set
stat/stat_rs.php: $sql = "insert into stat_log_".$log_month." set
stat/stat_rs_asp.php: $sql = "insert into stat_log_asp_".$log_month." set
stat/stat_rs_listing.php: $sql = "insert into stat_log_listing_".$log_month." set
macbook:aff haltyt$ grep -R INSERT stat | grep stat_log
stat/stat.php: $sql_indirect = "INSERT INTO stat_log_".$log_month." set
stat/stat.php: $sql_indirect = "INSERT INTO stat_log_asp_".$log_month." set
stat/stat.php: $sql_indirect = "INSERT INTO stat_log_listing_".$log_month." set
stat/stat_asp.php: $sql_indirect = "INSERT INTO stat_log_".$log_month." set
stat/stat_asp.php: $sql_indirect = "INSERT INTO stat_log_asp_".$log_month." set
stat/stat_asp.php: $sql_indirect = "INSERT INTO stat_log_listing_".$log_month." set
stat/stat_listing.php: $sql_indirect = "INSERT INTO stat_log_".$log_month." set
stat/stat_listing.php: $sql_indirect = "INSERT INTO stat_log_asp_".$log_month." set
stat/stat_listing.php: $sql_indirect = "INSERT INTO stat_log_listing_".$log_month." set
macbook:aff haltyt$ grep -R update stat | grep stat_log
stat/stat.php: $sql = "update stat_log_".$log_month." set
stat/stat.php: $sql = "update stat_log_media_".$log_month." set
stat/stat.php: $sql = "update stat_log_client_".$log_month." set
stat/stat.php: $sql = "update stat_log_banner_".$log_month." set
stat/stat.php: $sql = "update stat_log_item_".$log_month." set
stat/stat.php: $sql = "update stat_log_shop_".$log_month." set
stat/stat_am.php: $sql = "update stat_log_".$log_month." set
stat/stat_am.php: $sql = "update stat_log_media_".$log_month." set
stat/stat_am.php: $sql = "update stat_log_client_".$log_month." set
stat/stat_am.php: $sql = "update stat_log_banner_".$log_month." set
stat/stat_am_asp.php: $sql = "update stat_log_asp_".$log_month." set
stat/stat_am_asp.php: $sql = "update stat_log_client_".$log_month." set
stat/stat_am_listing.php: $sql = "update stat_log_listing_".$log_month." set
stat/stat_am_listing.php: $sql = "update stat_log_client_".$log_month." set
stat/stat_asp.php: $sql = "update stat_log_asp_".$log_month." set
stat/stat_asp.php: $sql = "update stat_log_client_".$log_month." set
stat/stat_asp.php: $sql = "update stat_log_banner_".$log_month." set
stat/stat_asp.php: $sql = "update stat_log_item_".$log_month." set
stat/stat_listing.php: $sql = "update stat_log_client_".$log_month." set
stat/stat_listing.php: $sql = "update stat_log_listing_".$log_month." set
stat/stat_rs.php: $sql = "update stat_log_".$log_month." set
stat/stat_rs.php: $sql = "update stat_log_".$log_month." set
stat/stat_rs_asp.php: $sql = "update stat_log_asp_".$log_month." set
stat/stat_rs_asp.php: $sql = "update stat_log_asp_".$log_month." set
stat/stat_rs_listing.php: $sql = "update stat_log_listing_".$log_month." set
macbook:aff haltyt$ grep -R UPDATE stat | grep stat_log
stat/stat.php: $sql_indirect = "UPDATE stat_log_".$log_month." set
stat/stat.php: $sql_indirect = "UPDATE stat_log_asp_".$log_month." set
stat/stat.php: $sql_indirect = "UPDATE stat_log_listing_".$log_month." set
stat/stat_asp.php: $sql_indirect = "UPDATE stat_log_".$log_month." set
stat/stat_asp.php: $sql_indirect = "UPDATE stat_log_asp_".$log_month." set
stat/stat_asp.php: $sql_indirect = "UPDATE stat_log_listing_".$log_month." set
stat/stat_listing.php: $sql_indirect = "UPDATE stat_log_".$log_month." set
stat/stat_listing.php: $sql_indirect = "UPDATE stat_log_asp_".$log_month." set
stat/stat_listing.php: $sql_indirect = "UPDATE stat_log_listing_".$log_month." set
macbook:aff haltyt$ grep -R update admin | grep stat_log
admin/www/content/search/log_reset.php: $tsql = "update stat_log_media_$month set
admin/www/content/search/log_reset_asp.php: $tsql = "update stat_log_client_$month set
admin/www/content/search/log_reset_listing.php: $tsql = "update stat_log_client_$month set
admin/www/log/csv_cost_update_db.php: $tsql = "update stat_log_".$admit_month." set
admin/www/log/csv_cost_update_db.php: $tsql = "update stat_log_".$admit_month." set
admin/www/log/csv_cost_update_db.php: $tsql = "update stat_log_media_".$admit_month." set
admin/www/log/csv_cost_update_db.php: $tsql = "update stat_log_media_".$admit_month." set
admin/www/log/csv_cost_update_db.php: $tsql = "update stat_log_asp_".$admit_month." set
admin/www/log/csv_cost_update_db.php: $tsql = "update stat_log_asp_".$admit_month." set
admin/www/log/csv_cost_update_db.php: $tsql = "update stat_log_client_".$admit_month." set
admin/www/log/csv_cost_update_db.php: $tsql = "update stat_log_client_".$admit_month." set
admin/www/log/csv_cost_update_db.php: $tsql = "update stat_log_banner_".$admit_month." set
admin/www/log/csv_cost_update_db.php: $tsql = "update stat_log_banner_".$admit_month." set
admin/www/stat/content/csv_resign_db.php: $tsql = "update stat_log_asp_".$resign_month." set
admin/www/stat/content/csv_resign_db.php: $tsql = "update stat_log_".$resign_month." set
admin/www/stat/resign_convert_db.php: $sql2 = "update stat_log_asp_".$resign_month." set
admin/www/stat/resign_convert_db.php: $sql2 = "update stat_log_".$resign_month." set
#13 山本 義治 が11年以上前に更新
テスト用URL¶
クリック
http://web1.i-generation.jp:8000/action/click.php?c=1040&m=618&i=1495&guid=ON
http://web2.i-generation.jp:8000/action/click.php?c=1040&m=618&i=1495&guid=ON
http://web1.i-generation.jp:8000/action/click_asp.php?cid=1040&asid=192&gid=1495&guid=ON
http://web2.i-generation.jp:8000/action/click_asp.php?cid=1040&asid=192&gid=1495&guid=ON
http://web1.i-generation.jp:8000/action/click_listing.php?cid=1040&lid=8&kid=14212&guid=ON
http://web2.i-generation.jp:8000/action/click_listing.php?cid=1040&lid=8&kid=14212&guid=ON
登録
http://web1.i-generation.jp:8000/action/conversion.php?c=1040&a=アフィリエイトID&u=1&p=成果ID
http://web2.i-generation.jp:8000/action/conversion.php?c=1040&a=アフィリエイトID&u=1&p=成果ID
承認、否認(管理画面)
http://i-generation.jp:8000/merchant/admit/index.php
http://web1.i-generation.jp:8000/admin/stat/content/report.php?c_id=01040
退会
http://web1.i-generation.jp:8000/action/resign.php?c=01040&a=アフィリエイトID
http://web2.i-generation.jp:8000/action/resign.php?c=01040&a=アフィリエイトID
退会解除(管理画面)
http://web1.i-generation.jp:8000/admin/stat/content/report.php?c_id=01040
#14 山本 義治 が11年以上前に更新
テストリリース
/www/aff_test_new/stat/stat.php
/www/aff_test_new/stat/stat_am.php
/www/aff_test_new/stat/stat_am_asp.php
/www/aff_test_new/stat/stat_am_listing.php
/www/aff_test_new/stat/stat_asp.php
/www/aff_test_new/stat/stat_listing.php
/www/aff_test_new/stat/stat_rs.php
/www/aff_test_new/stat/stat_rs_asp.php
/www/aff_test_new/stat/stat_rs_listing.php
/www/aff_test_new/admin/www/stat/content/report.php
/www/aff_test_new/admin/www/stat/content/csv_action_admit.php
/www/aff_test_new/admin/www/stat/content/csv_action_admit_db.php
/www/aff_test_new/admin/www/stat/content/csv_resign_db.php
/www/aff_test_new/admin/www/stat/resign_convert_db.php
/www/aff_test_new/admin/www/log/csv_cost_update.inc
/www/aff_test_new/admin/www/log/csv_cost_update_db.php
/www/aff_test_new/ad/www/ac/action.php
/www/aff_test_new/ad/www/ac/resign.php
#16 山本 義治 が11年以上前に更新
ログファイル出力ソースリスト¶
[admin@web1 aff_test_new]$ grep -R log_file *
ad/www/cl/click.php: $log_file = $log_path."/cl_".date("Ymd")."_".$log_time.".log";
ad/www/cl/click_asp.php: $log_file = $log_path."/cl_asp_".date("Ymd")."_".$log_time.".log";
ad/www/cl/click_app.php: $log_file = $log_path."/cl_".date("Ymd")."_".$log_time.".log";
ad/www/cl/click_listing.php: $log_file = $log_path."/cl_listing_".date("Ymd")."_".$log_time.".log";
ad/www/ac/resign.php: $log_file = $log_path."/rs_asp_".date("Ymd")."_".$log_time.".log";
ad/www/ac/action.php: $log_file = $log_path."/ac_asp_".date("Ymd")."_".$log_time.".log";
admin/www/stat/content/csv_action_admit_db.php: $log_file = $log_path."/am_asp_".date("Ymd")."_".$log_time.".log";
user/www/merchant/admit/csv_admit.php: $log_file = $log_path."/am_asp_".date("Ymd")."_".$log_time.".log";
user/www/merchant/admit/admit_ok.php: $log_file = $log_path."/am_asp_".date("Ymd")."_".$log_time.".log";
user/www/merchant/admit/admit_ng.php: $log_file = $log_path."/am_asp_".date("Ymd")."_".$log_time.".log";
#18 山本 義治 が11年以上前に更新
http://i-generation.jp:8000/action/click.php?c=1050&m=619&guid=ON
http://i-generation.jp:8000/action/click_asp.php?cid=1050&asid=192&af=##AFF_ID##&acid=##ASP_CID##&ainfo=##ASP_INFO##&guid=ON
http://i-generation.jp:8000/action/click_listing.php?cid=1050&lid=8&kid=14212&guid=ON
http://i-generation.jp:8000/action/conversion.php?c=1050&u=1&p=1
http://i-generation.jp:8000/action/resign.php?c=1050&a=
#19 山本 義治 が11年以上前に更新
ログ2重書き込みテストソース適用手順¶
(1) 本番環境DBのダンプをテスト環境DBへコピー
aff→aff_test2
(2) テスト環境DBへ定義変更適用
alter table stat_log_201309 add unique(stat_date,m_id,c_id,item_id,p_id);
...
(3) テスト環境DBの翌月分集計テーブル作成CRON手動実行
/usr/local/mysql/aff_test/cron/create_stat_log_*
(4) テスト環境集計ログファイルを手動消去
(5) 本番環境、テスト環境の集計CRON停止
(6) 本番環境へソース適用
- テスト環境へログコピー
/www/aff/lib/util.lib
function log_rotate2($log_file,$no){
global $SERVER_PATH,$SERVER_PATH2;if($no == "1")
$src_file = $log_file;
else
$src_file = $log_file.($no-1);$dst_file = $log_file.$no;
if(file_exists($dst_file))
log_rotate($log_file,$no+1);if($no == "1"){
$dst_file2 = str_replace($SERVER_PATH,$SERVER_PATH2,$log_file);
if(!file_exists($dst_file2)){
recursive_mkdir(dirname($dst_file2));
copy($src_file,$dst_file2);
}
}
rename($src_file,$dst_file);
}
/www/aff/set/server.inc
$SERVER_PATH2 = "/www/aff_test_new2";
/www/aff/stat/stat.php
/www/aff/stat/stat_asp.php
/www/aff/stat/stat_listing.php
/www/aff/stat/stat_am.php
/www/aff/stat/stat_am_asp.php
/www/aff/stat/stat_am_listing.php
/www/aff/stat/stat_rs.php
/www/aff/stat/stat_rs_asp.php
/www/aff/stat/stat_rs_listing.php
log_rotate2($log_file,1);
(7) 本番環境集計CRON手動実行
/www/aff/stat/stat*
(8) テスト環境集計CRON手動実行
/www/aff_test_new2/stat/stat*
(9) 本番環境、テスト環境とも動作確認
#22 山本 義治 が11年以上前に更新
select stat_date,asp_id,c_id,item_id,p_id,count(stat_log_id) as cnt,
sum(pv_count_pc)+sum(action_click_count_pc)+sum(click_count_pc)+sum(click_unique_count_pc)+sum(action_count_pc)+sum(admit_count_pc)+sum(cancel_count_pc)+sum(click_cost_pc)+sum(click_cost_cl_pc)+sum(action_cost_pc)+sum(action_cost_cl_pc)+sum(resign_count_pc)+sum(this_month_resign_count_pc) as pc,
sum(pv_count_d)+sum(action_click_count_d)+sum(click_count_d)+sum(click_unique_count_d)+sum(action_count_d)+sum(admit_count_d)+sum(cancel_count_d)+sum(click_cost_d)+sum(click_cost_cl_d)+sum(action_cost_d)+sum(action_cost_cl_d)+sum(resign_count_d)+sum(this_month_resign_count_d) as d,
sum(pv_count_v)+sum(action_click_count_v)+sum(click_count_v)+sum(click_unique_count_v)+sum(action_count_v)+sum(admit_count_v)+sum(cancel_count_v)+sum(click_cost_v)+sum(click_cost_cl_v)+sum(action_cost_v)+sum(action_cost_cl_v)+sum(resign_count_v)+sum(this_month_resign_count_v) as v,
sum(pv_count_e)+sum(action_click_count_e)+sum(click_count_e)+sum(click_unique_count_e)+sum(action_count_e)+sum(admit_count_e)+sum(cancel_count_e)+sum(click_cost_e)+sum(click_cost_cl_e)+sum(action_cost_e)+sum(action_cost_cl_e)+sum(resign_count_e)+sum(this_month_resign_count_e) as e,
sum(pv_count_i)+sum(action_click_count_i)+sum(click_count_i)+sum(click_unique_count_i)+sum(action_count_i)+sum(admit_count_i)+sum(cancel_count_i)+sum(click_cost_i)+sum(click_cost_cl_i)+sum(action_cost_i)+sum(action_cost_cl_i)+sum(resign_count_i)+sum(this_month_resign_count_i) as i,
sum(pv_count_a)+sum(action_click_count_a)+sum(click_count_a)+sum(click_unique_count_a)+sum(action_count_a)+sum(admit_count_a)+sum(cancel_count_a)+sum(click_cost_a)+sum(click_cost_cl_a)+sum(action_cost_a)+sum(action_cost_cl_a)+sum(resign_count_a)+sum(this_month_resign_count_a) as a
from stat_log_asp_201309
where stat_date = '2013-09-25'
group by stat_date,asp_id,c_id,item_id,p_id order by cnt desc ,stat_date,asp_id,c_id,item_id,p_id
#23 山本 義治 が11年以上前に更新
ログファイル数差分チェック
ll /www/aff/log/2013/20130926/cl_asp_20130926_00* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_00* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_01* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_01* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_02* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_02* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_03* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_03* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_04* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_04* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_05* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_05* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_06* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_06* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_07* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_07* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_08* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_08* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_09* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_09* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_10* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_10* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_11* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_11* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_12* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_12* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_13* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_13* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_14* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_14* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_15* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_15* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_16* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_16* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_17* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_17* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_18* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_18* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_19* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_19* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_20* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_20* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_21* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_21* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_22* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_22* | grep -c ""
ll /www/aff/log/2013/20130926/cl_asp_20130926_23* | grep -c ""
ll /www/aff_test_new2/log/2013/20130926/cl_asp_20130926_23* | grep -c ""
#24 山本 義治 が約11年前に更新
本番リリース¶
(1) aff_test_new2のソースをaff_test_newへ反映
/www/aff_test_new2/lib/util.lib
/www/aff_test_new2/lib/db.lib
/www/aff_test_new2/stat/stat.php
/www/aff_test_new2/stat/stat_asp.php
/www/aff_test_new2/stat/stat_listing.php
/www/aff_test_new2/stat/stat_rs.php
/www/aff_test_new2/stat/stat_rs_asp.php
/www/aff_test_new2/stat/stat_rs_listing.php
※stat_am系はチケット#2の確認待ちのためリリースしない
(2) 本番環境DBバックアップ
mysqldump -u root -p aff --lock-tables=false > aff.dump.20131017
(3) 本番環境DBへ定義変更適用
alter table stat_log_201310 add unique(stat_date,m_id,c_id,item_id,p_id);
alter table stat_log_asp_201310 add unique(stat_date,asp_id,c_id,item_id,p_id);
alter table stat_log_media_201310 add unique(stat_date,m_id);
alter table stat_log_client_201310 add unique(stat_date,c_id);
alter table stat_log_listing_201310 add unique(stat_date,listing_id,c_id,keyword_id,p_id);
alter table stat_log_banner_201310 add unique(stat_date,c_id);
alter table stat_log_item_201310 add unique(stat_date,m_id,asp_id,c_id,item_id);
alter table stat_log_shop_201310 add unique(stat_date,m_id,c_id,shop_id);
(4) 本番環境DBの翌月分集計テーブル作成CRON変更
/usr/local/mysql/aff
create_stat_log_YYYYMM.php
create_stat_log_asp_YYYYMM.php
create_stat_log_banner_YYYYMM.php
create_stat_log_client_YYYYMM.php
create_stat_log_item_YYYYMM.php
create_stat_log_listing_YYYYMM.php
create_stat_log_media_YYYYMM.php
create_stat_log_shop_YYYYMM.php
(5) 本番環境DBの翌月分集計テーブル作成CRON手動実行
(6) 本番環境web1,web2の集計CRON停止
(7) aff_test_newのソースを本番環境へ適用
/www/aff_test_new/lib/util.lib
/www/aff_test_new/lib/db.lib
/www/aff_test_new/stat/stat.php
/www/aff_test_new/stat/stat_asp.php
/www/aff_test_new/stat/stat_listing.php
/www/aff_test_new/stat/stat_rs.php
/www/aff_test_new/stat/stat_rs_asp.php
/www/aff_test_new/stat/stat_rs_listing.php
(8) 各ソースヘッダ部パス変更
< require("/www/aff/ad/const.inc");
---
require("/www/aff_test_new/ad/const.inc");
(9) 本番環境web1,web2の集計CRON手動実行してエラーがでないことを確認
(10) 本番環境web1,web2の集計CRON再開
(11) aff_test_new2:web1,web2の集計CRON停止
(12) 動作確認(クリック、登録、承認・否認、退会)